diff --git a/Makefile b/Makefile
index 816bfcdc..320b75e0 100644
--- a/Makefile
+++ b/Makefile
@@ -23,12 +23,11 @@ install-generator: install ## Install dependencies for SDK code generator
npm install
generate: install-generator ## Generate the SDK from our public openapi spec
- node_modules/.bin/openapi-generator-cli generate -i spec/public-api.yaml \
- -g python \
+ node_modules/.bin/openapi-generator-cli generate \
+ -i spec/public-api.yaml \
+ -g python-pydantic-v1 \
-o ./generated \
--additional-properties=packageName=groundlight_openapi_client
-# strict-nullable makes nullable fields Optional in the generated Pydantic classes: https://github.com/koxudaxi/datamodel-code-generator/issues/327
- poetry run datamodel-codegen --input spec/public-api.yaml --output generated/model.py --strict-nullable --use-schema-description --output-model-type pydantic_v2.BaseModel --use-subclass-enum
poetry run black .
PYTEST=poetry run pytest -v
@@ -68,7 +67,8 @@ test-docs-integ: install-extras ## Run the example code and tests in our docs a
GROUNDLIGHT_ENDPOINT="https://api.integ.groundlight.ai/" ${PYTEST} --markdown-docs ${TEST_ARGS} docs README.md
# Adjust which paths we lint
-LINT_PATHS="src test bin samples"
+# LINT_PATHS="src test bin samples"
+LINT_PATHS="src test"
lint: install-lint ## Run linter to check formatting and style
./code-quality/lint ${LINT_PATHS}
diff --git a/bin/simple_example.py b/bin/simple_example.py
deleted file mode 100644
index 3382b971..00000000
--- a/bin/simple_example.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from groundlight import Groundlight
-
-gl = Groundlight()
-detectors = gl.list_detectors()
-print(f"Found {detectors.count} detectors")
diff --git a/docs/.gitignore b/docs/.gitignore
deleted file mode 100644
index b58c623c..00000000
--- a/docs/.gitignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Dependencies
-/node_modules
-
-# Production
-/build
-
-# Generated files
-.docusaurus
-.cache-loader
-.package-lock.json
-# api-reference-docs are generated by sphinx and placed here.
-/static/api-reference-docs/
-
-# Misc
-.DS_Store
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
diff --git a/docs/README.md b/docs/README.md
deleted file mode 100644
index 38fe9281..00000000
--- a/docs/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Documentation: code.groundlight.ai
-
-This part of the SDK repo contains all the code for the website at [code.groundlight.ai](https://code.groundlight.ai/) It is built with [Docusaurus 2](https://docusaurus.io/).
-
-The docs are included with the SDK so that we can automate testing of the code samples in the documentation. This way we can ensure that the code samples in our docs always work with the current SDK.
-
-## Previewing doc changes
-
-Doc changes are published automatically when they're merged to main. To preview changes, build and host the site locally. You'll need a reasonably modern version of `npm` and then:
-
-```
-cd docs
-npm install
-cd ..
-make develop-docs-comprehensive
-```
-
-and then open [http://localhost:3000/python-sdk](http://localhost:3000/python-sdk).
-
-Or if you're feeling luck, you can try `./start_docs_server.sh` which also rebuilds the sphinx docs on every change.
-This script is tested on MacOS with [homebrew](https://brew.sh/) installed, but could work elsewhere too.
-
-## Running docs tests
-
-You'll need `python poetry` and `make` installed. And you'll need an API Token configured. Then you can just run:
-
-```
-make test-docs
-```
-
diff --git a/docs/babel.config.js b/docs/babel.config.js
deleted file mode 100644
index e00595da..00000000
--- a/docs/babel.config.js
+++ /dev/null
@@ -1,3 +0,0 @@
-module.exports = {
- presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
-};
diff --git a/docs/blog/2024-01-16-binomial-tails.md b/docs/blog/2024-01-16-binomial-tails.md
deleted file mode 100644
index 4b37c709..00000000
--- a/docs/blog/2024-01-16-binomial-tails.md
+++ /dev/null
@@ -1,390 +0,0 @@
----
-title: "Tales from the Binomial Tail: Confidence intervals for balanced accuracy"
-description: How we assess and report detector accuracy
-slug: confidence-intervals-for-balanced-accuracy
-authors:
- - name: Ted Sandler
- title: Senior Applied Scientist at Groundlight
- image_url: https://a-us.storyblok.com/f/1015187/1000x1000/efc35da152/sandlert.jpg
- - name: Leo Dirac
- title: CTO and Co-founder at Groundlight
- image_url: https://a-us.storyblok.com/f/1015187/284x281/602a9c95c5/diracl.png
-tags: [metrics, math, deep dive]
-image: ./images/binomial-tails/binomial_confidence_intervals__muted_theme__social.png
-hide_table_of_contents: false
----
-
-At Groundlight, we put careful thought into measuring the correctness of our machine learning detectors. In the simplest case, this means measuring detector accuracy. But our customers have vastly different performance needs since our platform allows them to train an ML model for nearly any Yes/No visual question-answering task. A single metric like accuracy is unlikely to provide adequate resolution for all such problems. Some customers might care more about false positive mistakes (precision) whereas others might care more about false negatives (recall).
-
-
-
-To provide insight for an endless variety of use cases yet still summarize performance with a single number, Groundlight's **accuracy details** view displays each detector's [balanced accuracy](https://scikit-learn.org/stable/modules/model_evaluation.html#balanced-accuracy-score). Balanced accuracy is the average of recall for all classes and is Groundlight's preferred summary metric. For binary problems, this is just the mean of accuracy on the should-be-YES images and accuracy on the should-be-NOs. We prefer balanced accuracy because it is easier to understand than metrics like the F1 score or AUROC. And since many commercially interesting problems are highly imbalanced - that is the answer is almost always YES or always NO - standard accuracy is not a useful performance measure because always predicting the most common class will yield high accuracy but be useless in practice.
-
-
-
-
-
- Figure 1: the detector accuracy details view shows balanced accuracy and per-class accuracy with exact 95% confidence intervals
-
-
-
-
-However, we've found that just displaying the balanced accuracy is not informative enough, as we do not always have an ample supply of **ground truth** labeled images to estimate it from. Ground truth labels are answers to image queries that have been provided by a customer, or customer representative, and are therefore trusted to be correct. With only a few ground truth labels, the estimate of a detector's balanced accuracy may itself be inaccurate. As such, we find it helpful to quantify and display the degree of possible inaccuracy by constructing confidence intervals for balanced accuracy, which brings us to the subject of this blog post!
-
-At Groundlight, we compute and display **exact** confidence intervals in order to upper and lower bound each detector's balanced accuracy, and thereby convey the amount of precision in the reported metric. The detector's accuracy details view displays these intervals as colored bars surrounding the reported accuracy numbers (see figure 1, above). This blog post describes the mathematics behind how we compute the intervals using the tails of the binomial distribution, and it also strives to provide a healthy amount of intuition for the math.
-
-Unlike the approximate confidence intervals based on the Gaussian distribution, which you may be familiar with, confidence intervals based on the binomial tails are exact, regardless of the number of ground truth labels we have available. Our exposition largely follows [Langford, 2005](https://jmlr.org/papers/v6/langford05a.html) and we use his "program bound" as a primitive to construct confidence intervals for the balanced accuracy metric.
-
-## Background
-
-To estimate and construct confidence intervals for balanced accuracy, we first need to understand how to construct confidence intervals for standard "plain old" accuracy. So we'll start here.
-
-Recall that standard accuracy is just the fraction of predictions a classifier makes which happen to be correct. This sounds simple enough, but to define this fraction rigorously, we actually need to make assumptions. To see why, consider the case that our classifier performs well on daytime images but poorly on nighttime ones. If the stream of images consists mainly of daytime photos, then our classifier's accuracy will be high, but if it's mainly nighttime images, our classifier's accuracy will be low. Or if the stream of images drifts slowly over time from day to nighttime images, our classifier won't even have a single accuracy. Its accuracy will be time-period dependent.
-
-Therefore, a classifier's "true accuracy" is inherently a function of the distribution of examples it's applied to. In practice, we almost never know what this distribution is. In fact, it's something of a mathematical fiction. But it happens to be a useful fiction in so far as it reflects reality, in that it lets us do things like bound the Platonic true accuracy of a classifier and otherwise reason about out-of-sample performance. Consequently, we make the assumption that there exists a distribution over the set of examples that our classifier sees, and that this distribution remains fixed over time.
-
-Let's call the distribution over images that our classifier sees, $D$. Each example in $D$ consists of an image, $x \in \mathcal{X}$, and an associated binary label, $y \in$ \{ YES, NO \}, which is the answer to the query. Let $(x,y) \sim D$ denote the action of sampling an example from $D$. We conceptualize our machine learning classifier as a function, $h$, which maps from the set of images, $\mathcal{X}$, to the set of labels, $\mathcal{Y}$. We say that $h$ correctly classifies an example $(x,y)$ if $h(x) = y$, and that $h$ misclassifies it otherwise.
-
-For now, our goal is to construct a confidence inverval for the true, but unknown, accuracy of $h$. We define this true accuracy as the probability that $h$ correctly classifies an example drawn from $D$:
-$$
- \text{acc}_{D}(h) = \Pr_{(x,y) \sim D}[ \,h(x) = y\, ].
-$$
-
-The true accuracy is impossible to compute exactly because $D$ is unknown and the universe of images is impossibly large. However, we can estimate it by evaluating $h$ on a finite set of test examples, $S$, which have been [drawn i.i.d.](https://en.wikipedia.org/wiki/Independent_and_identically_distributed_random_variables) from $D$. That is,
-$$
-S = \{ (x_1, y_1), (x_2, y_2), ..., (x_{n}, y_{n}) \}
-$$
-where each $(x_i, y_i) \sim D$ for $i=1,\ldots,n$.
-
-The fraction of images in $S$ that $h$ correctly classifies is called $h$'s empirical accuracy on $S$, and this fraction is computed as
-$$
-\widehat{\text{acc}}_{S}(h) = \frac{1}{n} \sum_{i=1}^n \mathbf{1}[\, h(x_i) = y_i \,].
-$$
-
-The notation $\mathbf{1}[\, \texttt{condition} \,]$ is shorthand for the indicator function which equals 1 when the $\texttt{condition}$ is true and 0 otherwise. So the formula above just sums the number of examples in $S$ that are correctly classified and then multiplies by 1/n.
-
-The egg-shaped infographic below depicts the scenario of estimating $h$'s true accuracy from its performance on a finite test set. The gray ellipse represents the full distribution of examples, $D$. Each dot corresponds to a single example image, $x$, whose true label, $y$, is represented by the dot's color - red for YES and blue for NO. The classifier, $h$, is represented by the dotted black line. Here, $h$ is the decision rule that classifies all points to the left of the line as should-be YES and all points to the right as should-be-NO. The points with light gray circles around them are the ones that have been sampled to form the test set, $S$.
-
-
-
-
-
- Figure 2: true accuracy can only be estimated from performance on a finite test set. The gray shaded region
- represents the full distribution. The lightly circled points are examples sampled for the test set.
-
-
-
-
-In this case, our choice of test set, $S$, was unlucky because $h$'s empirical accuracy on $S$ looks great, appearing to be 9/9 = 100%. But evaluating $h$ on the full distribution of examples, $D$, reveals that its true accuracy is much lower, only 24/27 = 89%. If our goal is to rarely be fooled into thinking that $h$'s performance is much better than it really is, then this particular test set was unfortunate in the sense that $h$ performs misleadingly well.
-
-
-## Test Set Accuracy and Coin Flips
-
-It turns out that the problem of determining a classifier's true accuracy from its performance on a finite test set exactly mirrors the problem of determining the bias of a possibly unfair coin after observing some number of flips. In this analogy, the act of classifying an example corresponds to flipping the coin, and the coin landing heads corresponds to the classifier's prediction being correct.
-
-Usefully, the binomial distribution completely characterizes the probability of observing $k$ heads in $N$ independent tosses of a biased coin whose bias, or propensity to land heads, is known to be the probability, $p$, through its probability mass function (PMF), defined as
-$$
-f_{N,p}(k) = {N \choose k} p^k (1 - p)^{N-k}.
-$$
-
-The cumulative density function (CDF) is the associated function that sums up the PMF probabilities over all outcomes (i.e., number of heads) from 0 through $k$. It tells us the probability of observing $k$ or fewer heads in $N$ independent tosses when the coin's bias is the probability $p$. The CDF is defined as
-$$
-F_{N,p}(k) = \sum_{j = 0}^k f_{N,p}(k).
-$$
-
-Below we've plotted the PMF (left) and CDF (right) functions for a binomial distribution whose parameters are *N*=30 and *p*=0.3.
-
-
-
-
-
-
-
-The PMF looks like a symmetric "bell curve". Its x-axis is the number of tosses that are heads, $k$. And its y-axis is the probability of observing $k$ heads in $N$ tosses. The CDF plot shows the cumulative sum of the PMF probabilities up through $k$ on its y-axis. The CDF is a monotonically increasing function of $k$. Its value is 1.0 on the right side of the plot since the sum of all PMF probabilities must equal one.
-
-The binomial PMF doesn't always resemble a bell-shaped curve. This is true of the binomial distributions in the two plots below, whose respective bias parameters are p=0.15 and p=0.96.
-
-
- );
-}
-
-export default function Home(): JSX.Element {
-
-const code = `import groundlight
-from framegrab import FrameGrabber
-
-# Initialize Groundlight client and create a Detector
-gl = groundlight.Groundlight()
-detector = gl.get_or_create_detector(name="doorway", query="Is the doorway open?")
-
-# Grab an image from a camera or video stream
-grabber = list(FrameGrabber.autodiscover().values())[0]
-image = grabber.grab()
-
-# Process image and get a confident answer to the Detector's query
-image_query = gl.ask_confident(detector, image)
-print(image_query)`;
-// Split the code into lines
- const codeLines = code.split("\n");
-
- return (
-
-
-
-
-
-
-
Build custom computer vision apps - faster & more reliably
-
-
With Groundlight’s Python SDK, you don’t need to be a machine learning scientist to develop your own
- computer vision application. Groundlight’s fully managed computer vision solution takes care of the ML so
- you can focus on building.
Aspects such as selecting the model architecture, choosing hyperparameters, determining the training
- dataset, or managing dataset labels are automated
-
-
-
-
-
-
-
-
24/7 Human Annotation
-
No need to label all your images yourself, Groundlight system provides annotation by humans, 24/7
-
-
-
-
-
-
-
-
Fast Edge Inference
-
On-premises deployment, so you can have real-time predictions without having to rely on the cloud
-
-
-
-
-
-
-
-
-
Groundlight integrations and compatibility
-
-
-
Groundlight is compatible across major development platforms and available through a REST API or Python
- SDK. Enjoy easy deployments using Arduino, Raspberry Pi, or any number of hardware kits.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Python SDK
-
With only a few lines of code, you can have custom computer vision inside your application.
Seamlessly integrate AI-driven perception into ROS2 projects, enabling natural language queries and
- real-time decision-making for smarter, more adaptable robotic systems.
- );
-}
\ No newline at end of file
diff --git a/docs/src/pages/markdown-page.md b/docs/src/pages/markdown-page.md
deleted file mode 100644
index 9756c5b6..00000000
--- a/docs/src/pages/markdown-page.md
+++ /dev/null
@@ -1,7 +0,0 @@
----
-title: Markdown page example
----
-
-# Markdown page example
-
-You don't need React to write simple standalone pages.
diff --git a/docs/src/theme/Layout.tsx b/docs/src/theme/Layout.tsx
deleted file mode 100644
index ee539f55..00000000
--- a/docs/src/theme/Layout.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import React from 'react';
-import OriginalLayout from '@theme-original/Layout';
-import useIntercom from '@site/src/hooks/useIntercom';
-
-function Layout(props) {
- useIntercom();
-
- return ;
-}
-
-export default Layout;
\ No newline at end of file
diff --git a/docs/static/img/1-models.png b/docs/static/img/1-models.png
deleted file mode 100644
index ada81827..00000000
Binary files a/docs/static/img/1-models.png and /dev/null differ
diff --git a/docs/static/img/2-reliability.png b/docs/static/img/2-reliability.png
deleted file mode 100644
index bd89c417..00000000
Binary files a/docs/static/img/2-reliability.png and /dev/null differ
diff --git a/docs/static/img/3-mlops.png b/docs/static/img/3-mlops.png
deleted file mode 100644
index 6a5161a3..00000000
Binary files a/docs/static/img/3-mlops.png and /dev/null differ
diff --git a/docs/static/img/allow_serial_access.png b/docs/static/img/allow_serial_access.png
deleted file mode 100644
index 9041efe8..00000000
Binary files a/docs/static/img/allow_serial_access.png and /dev/null differ
diff --git a/docs/static/img/brain1.png b/docs/static/img/brain1.png
deleted file mode 100644
index cb94fe8b..00000000
Binary files a/docs/static/img/brain1.png and /dev/null differ
diff --git a/docs/static/img/brain2.png b/docs/static/img/brain2.png
deleted file mode 100644
index 08ce6fc7..00000000
Binary files a/docs/static/img/brain2.png and /dev/null differ
diff --git a/docs/static/img/brain3.png b/docs/static/img/brain3.png
deleted file mode 100644
index d9b792bd..00000000
Binary files a/docs/static/img/brain3.png and /dev/null differ
diff --git a/docs/static/img/burger-menu-right-svgrepo-com.svg b/docs/static/img/burger-menu-right-svgrepo-com.svg
deleted file mode 100644
index 1decc3a2..00000000
--- a/docs/static/img/burger-menu-right-svgrepo-com.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
\ No newline at end of file
diff --git a/docs/static/img/close-svgrepo-com.svg b/docs/static/img/close-svgrepo-com.svg
deleted file mode 100644
index 14f528a1..00000000
--- a/docs/static/img/close-svgrepo-com.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
\ No newline at end of file
diff --git a/docs/static/img/cnc-gripper-bgr.jpg b/docs/static/img/cnc-gripper-bgr.jpg
deleted file mode 100644
index f898796b..00000000
Binary files a/docs/static/img/cnc-gripper-bgr.jpg and /dev/null differ
diff --git a/docs/static/img/cnc-gripper.jpg b/docs/static/img/cnc-gripper.jpg
deleted file mode 100644
index f62fe844..00000000
Binary files a/docs/static/img/cnc-gripper.jpg and /dev/null differ
diff --git a/docs/static/img/dev_logo_dark.svg b/docs/static/img/dev_logo_dark.svg
deleted file mode 100644
index a28b2b00..00000000
--- a/docs/static/img/dev_logo_dark.svg
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
\ No newline at end of file
diff --git a/docs/static/img/docker-img-dashboard.png b/docs/static/img/docker-img-dashboard.png
deleted file mode 100644
index 2ca5313b..00000000
Binary files a/docs/static/img/docker-img-dashboard.png and /dev/null differ
diff --git a/docs/static/img/docker-img-frontpage.png b/docs/static/img/docker-img-frontpage.png
deleted file mode 100644
index 3e567f29..00000000
Binary files a/docs/static/img/docker-img-frontpage.png and /dev/null differ
diff --git a/docs/static/img/doorway.jpg b/docs/static/img/doorway.jpg
deleted file mode 100644
index 0fe3e611..00000000
Binary files a/docs/static/img/doorway.jpg and /dev/null differ
diff --git a/docs/static/img/eagle_detector.png b/docs/static/img/eagle_detector.png
deleted file mode 100644
index 067295ed..00000000
Binary files a/docs/static/img/eagle_detector.png and /dev/null differ
diff --git a/docs/static/img/edge-endpoint-latency.png b/docs/static/img/edge-endpoint-latency.png
deleted file mode 100644
index 801efdd4..00000000
Binary files a/docs/static/img/edge-endpoint-latency.png and /dev/null differ
diff --git a/docs/static/img/edge-endpoint-throughput.png b/docs/static/img/edge-endpoint-throughput.png
deleted file mode 100644
index 776f8907..00000000
Binary files a/docs/static/img/edge-endpoint-throughput.png and /dev/null differ
diff --git a/docs/static/img/escalation_diagram.jpg b/docs/static/img/escalation_diagram.jpg
deleted file mode 100644
index e8f46c85..00000000
Binary files a/docs/static/img/escalation_diagram.jpg and /dev/null differ
diff --git a/docs/static/img/esp32-cam.png b/docs/static/img/esp32-cam.png
deleted file mode 100644
index 7d0c6d7c..00000000
Binary files a/docs/static/img/esp32-cam.png and /dev/null differ
diff --git a/docs/static/img/favicon-32x32.png b/docs/static/img/favicon-32x32.png
deleted file mode 100755
index 2578fc60..00000000
Binary files a/docs/static/img/favicon-32x32.png and /dev/null differ
diff --git a/docs/static/img/favicon.ico b/docs/static/img/favicon.ico
deleted file mode 100644
index eadbd360..00000000
Binary files a/docs/static/img/favicon.ico and /dev/null differ
diff --git a/docs/static/img/gl-icon400.png b/docs/static/img/gl-icon400.png
deleted file mode 100644
index a3abcaad..00000000
Binary files a/docs/static/img/gl-icon400.png and /dev/null differ
diff --git a/docs/static/img/logo-arduino.png b/docs/static/img/logo-arduino.png
deleted file mode 100644
index 8f1f56a5..00000000
Binary files a/docs/static/img/logo-arduino.png and /dev/null differ
diff --git a/docs/static/img/logo-aws.png b/docs/static/img/logo-aws.png
deleted file mode 100644
index e06cc5f1..00000000
Binary files a/docs/static/img/logo-aws.png and /dev/null differ
diff --git a/docs/static/img/logo-boston-dynamics.png b/docs/static/img/logo-boston-dynamics.png
deleted file mode 100644
index 0cb6db72..00000000
Binary files a/docs/static/img/logo-boston-dynamics.png and /dev/null differ
diff --git a/docs/static/img/logo-github.png b/docs/static/img/logo-github.png
deleted file mode 100644
index e67a8796..00000000
Binary files a/docs/static/img/logo-github.png and /dev/null differ
diff --git a/docs/static/img/logo-nvidia.png b/docs/static/img/logo-nvidia.png
deleted file mode 100644
index 4096267b..00000000
Binary files a/docs/static/img/logo-nvidia.png and /dev/null differ
diff --git a/docs/static/img/logo-python.png b/docs/static/img/logo-python.png
deleted file mode 100644
index ef8bb47c..00000000
Binary files a/docs/static/img/logo-python.png and /dev/null differ
diff --git a/docs/static/img/logo-ras.png b/docs/static/img/logo-ras.png
deleted file mode 100644
index 81b905d6..00000000
Binary files a/docs/static/img/logo-ras.png and /dev/null differ
diff --git a/docs/static/img/logo.png b/docs/static/img/logo.png
deleted file mode 100644
index eafa9220..00000000
Binary files a/docs/static/img/logo.png and /dev/null differ
diff --git a/docs/static/img/m5stack_timer_camera.png b/docs/static/img/m5stack_timer_camera.png
deleted file mode 100644
index 2ff321ef..00000000
Binary files a/docs/static/img/m5stack_timer_camera.png and /dev/null differ
diff --git a/docs/static/img/m5stack_timer_camera_x.png b/docs/static/img/m5stack_timer_camera_x.png
deleted file mode 100644
index 35af675b..00000000
Binary files a/docs/static/img/m5stack_timer_camera_x.png and /dev/null differ
diff --git a/docs/static/img/michonne-bgr.jpg b/docs/static/img/michonne-bgr.jpg
deleted file mode 100644
index fce750af..00000000
Binary files a/docs/static/img/michonne-bgr.jpg and /dev/null differ
diff --git a/docs/static/img/michonne.jpg b/docs/static/img/michonne.jpg
deleted file mode 100644
index 4c0707d9..00000000
Binary files a/docs/static/img/michonne.jpg and /dev/null differ
diff --git a/docs/static/img/support.png b/docs/static/img/support.png
deleted file mode 100644
index ab631b76..00000000
Binary files a/docs/static/img/support.png and /dev/null differ
diff --git a/docs/static/img/universal-robotics-logo.png b/docs/static/img/universal-robotics-logo.png
deleted file mode 100644
index d1beb361..00000000
Binary files a/docs/static/img/universal-robotics-logo.png and /dev/null differ
diff --git a/docs/static/img/x.png b/docs/static/img/x.png
deleted file mode 100644
index 866eac9a..00000000
Binary files a/docs/static/img/x.png and /dev/null differ
diff --git a/docs/static/img/xiao-esp32s3-sense.png b/docs/static/img/xiao-esp32s3-sense.png
deleted file mode 100644
index e3cf4955..00000000
Binary files a/docs/static/img/xiao-esp32s3-sense.png and /dev/null differ
diff --git a/docs/static/img/youtube.png b/docs/static/img/youtube.png
deleted file mode 100644
index d9943c53..00000000
Binary files a/docs/static/img/youtube.png and /dev/null differ
diff --git a/docs/tsconfig.json b/docs/tsconfig.json
deleted file mode 100644
index 6f475698..00000000
--- a/docs/tsconfig.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- // This file is not used in compilation. It is here just for a nice editor experience.
- "extends": "@tsconfig/docusaurus/tsconfig.json",
- "compilerOptions": {
- "baseUrl": "."
- }
-}
diff --git a/generated/.github/workflows/python.yml b/generated/.github/workflows/python.yml
new file mode 100644
index 00000000..418c66dc
--- /dev/null
+++ b/generated/.github/workflows/python.yml
@@ -0,0 +1,38 @@
+# NOTE: This file is auto generated by OpenAPI Generator.
+# URL: https://openapi-generator.tech
+#
+# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
+
+name: groundlight_openapi_client Python package
+
+on: [push, pull_request]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+ - name: Install dependencies
+ run: |
+ python -m pip install --upgrade pip
+ pip install flake8 pytest
+ if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+ if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
+ - name: Lint with flake8
+ run: |
+ # stop the build if there are Python syntax errors or undefined names
+ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
+ flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
+ - name: Test with pytest
+ run: |
+ pytest
diff --git a/generated/.openapi-generator/FILES b/generated/.openapi-generator/FILES
index 07eb726b..89b440ae 100644
--- a/generated/.openapi-generator/FILES
+++ b/generated/.openapi-generator/FILES
@@ -1,7 +1,7 @@
+.github/workflows/python.yml
.gitignore
README.md
docs/Action.md
-docs/ActionList.md
docs/ActionsApi.md
docs/AllNotes.md
docs/AnnotationsRequestedEnum.md
@@ -18,24 +18,26 @@ docs/CountModeConfiguration.md
docs/CountingResult.md
docs/Detector.md
docs/DetectorCreationInputRequest.md
+docs/DetectorCreationInputRequestModeConfiguration.md
docs/DetectorGroup.md
docs/DetectorGroupRequest.md
docs/DetectorGroupsApi.md
docs/DetectorResetApi.md
+docs/DetectorStatus.md
docs/DetectorTypeEnum.md
docs/DetectorsApi.md
docs/EdgeApi.md
docs/EdgeModelInfo.md
docs/EscalationTypeEnum.md
+docs/GetDetectorEvaluation200Response.md
+docs/GetDetectorEvaluation200ResponseEvaluationResults.md
+docs/GetDetectorMetrics200Response.md
+docs/GetDetectorMetrics200ResponseSummary.md
+docs/GetDetectorMetrics200ResponseSummaryClassCounts.md
docs/ImageQueriesApi.md
docs/ImageQuery.md
+docs/ImageQueryResult.md
docs/ImageQueryTypeEnum.md
-docs/InlineResponse200.md
-docs/InlineResponse2001.md
-docs/InlineResponse2001EvaluationResults.md
-docs/InlineResponse2002.md
-docs/InlineResponse200Summary.md
-docs/InlineResponse200SummaryClassCounts.md
docs/Label.md
docs/LabelValue.md
docs/LabelValueRequest.md
@@ -56,6 +58,7 @@ docs/ROI.md
docs/ROIRequest.md
docs/ResultTypeEnum.md
docs/Rule.md
+docs/RuleAction.md
docs/RuleRequest.md
docs/SnoozeTimeUnitEnum.md
docs/Source.md
@@ -67,6 +70,7 @@ docs/UserApi.md
docs/VerbEnum.md
docs/WebhookAction.md
docs/WebhookActionRequest.md
+docs/WhoAmI200Response.md
git_push.sh
groundlight_openapi_client/__init__.py
groundlight_openapi_client/api/__init__.py
@@ -80,76 +84,77 @@ groundlight_openapi_client/api/labels_api.py
groundlight_openapi_client/api/notes_api.py
groundlight_openapi_client/api/user_api.py
groundlight_openapi_client/api_client.py
-groundlight_openapi_client/apis/__init__.py
+groundlight_openapi_client/api_response.py
groundlight_openapi_client/configuration.py
groundlight_openapi_client/exceptions.py
-groundlight_openapi_client/model/__init__.py
-groundlight_openapi_client/model/action.py
-groundlight_openapi_client/model/action_list.py
-groundlight_openapi_client/model/all_notes.py
-groundlight_openapi_client/model/annotations_requested_enum.py
-groundlight_openapi_client/model/b_box_geometry.py
-groundlight_openapi_client/model/b_box_geometry_request.py
-groundlight_openapi_client/model/binary_classification_result.py
-groundlight_openapi_client/model/blank_enum.py
-groundlight_openapi_client/model/bounding_box_mode_configuration.py
-groundlight_openapi_client/model/bounding_box_result.py
-groundlight_openapi_client/model/channel_enum.py
-groundlight_openapi_client/model/condition.py
-groundlight_openapi_client/model/condition_request.py
-groundlight_openapi_client/model/count_mode_configuration.py
-groundlight_openapi_client/model/counting_result.py
-groundlight_openapi_client/model/detector.py
-groundlight_openapi_client/model/detector_creation_input_request.py
-groundlight_openapi_client/model/detector_group.py
-groundlight_openapi_client/model/detector_group_request.py
-groundlight_openapi_client/model/detector_type_enum.py
-groundlight_openapi_client/model/edge_model_info.py
-groundlight_openapi_client/model/escalation_type_enum.py
-groundlight_openapi_client/model/image_query.py
-groundlight_openapi_client/model/image_query_type_enum.py
-groundlight_openapi_client/model/inline_response200.py
-groundlight_openapi_client/model/inline_response2001.py
-groundlight_openapi_client/model/inline_response2001_evaluation_results.py
-groundlight_openapi_client/model/inline_response2002.py
-groundlight_openapi_client/model/inline_response200_summary.py
-groundlight_openapi_client/model/inline_response200_summary_class_counts.py
-groundlight_openapi_client/model/label.py
-groundlight_openapi_client/model/label_value.py
-groundlight_openapi_client/model/label_value_request.py
-groundlight_openapi_client/model/mode_enum.py
-groundlight_openapi_client/model/multi_class_mode_configuration.py
-groundlight_openapi_client/model/multi_classification_result.py
-groundlight_openapi_client/model/note.py
-groundlight_openapi_client/model/note_request.py
-groundlight_openapi_client/model/paginated_detector_list.py
-groundlight_openapi_client/model/paginated_image_query_list.py
-groundlight_openapi_client/model/paginated_rule_list.py
-groundlight_openapi_client/model/patched_detector_request.py
-groundlight_openapi_client/model/payload_template.py
-groundlight_openapi_client/model/payload_template_request.py
-groundlight_openapi_client/model/result_type_enum.py
-groundlight_openapi_client/model/roi.py
-groundlight_openapi_client/model/roi_request.py
-groundlight_openapi_client/model/rule.py
-groundlight_openapi_client/model/rule_request.py
-groundlight_openapi_client/model/snooze_time_unit_enum.py
-groundlight_openapi_client/model/source.py
-groundlight_openapi_client/model/source_enum.py
-groundlight_openapi_client/model/status_enum.py
-groundlight_openapi_client/model/text_mode_configuration.py
-groundlight_openapi_client/model/text_recognition_result.py
-groundlight_openapi_client/model/verb_enum.py
-groundlight_openapi_client/model/webhook_action.py
-groundlight_openapi_client/model/webhook_action_request.py
-groundlight_openapi_client/model_utils.py
groundlight_openapi_client/models/__init__.py
+groundlight_openapi_client/models/action.py
+groundlight_openapi_client/models/all_notes.py
+groundlight_openapi_client/models/annotations_requested_enum.py
+groundlight_openapi_client/models/b_box_geometry.py
+groundlight_openapi_client/models/b_box_geometry_request.py
+groundlight_openapi_client/models/binary_classification_result.py
+groundlight_openapi_client/models/blank_enum.py
+groundlight_openapi_client/models/bounding_box_mode_configuration.py
+groundlight_openapi_client/models/bounding_box_result.py
+groundlight_openapi_client/models/channel_enum.py
+groundlight_openapi_client/models/condition.py
+groundlight_openapi_client/models/condition_request.py
+groundlight_openapi_client/models/count_mode_configuration.py
+groundlight_openapi_client/models/counting_result.py
+groundlight_openapi_client/models/detector.py
+groundlight_openapi_client/models/detector_creation_input_request.py
+groundlight_openapi_client/models/detector_creation_input_request_mode_configuration.py
+groundlight_openapi_client/models/detector_group.py
+groundlight_openapi_client/models/detector_group_request.py
+groundlight_openapi_client/models/detector_status.py
+groundlight_openapi_client/models/detector_type_enum.py
+groundlight_openapi_client/models/edge_model_info.py
+groundlight_openapi_client/models/escalation_type_enum.py
+groundlight_openapi_client/models/get_detector_evaluation200_response.py
+groundlight_openapi_client/models/get_detector_evaluation200_response_evaluation_results.py
+groundlight_openapi_client/models/get_detector_metrics200_response.py
+groundlight_openapi_client/models/get_detector_metrics200_response_summary.py
+groundlight_openapi_client/models/get_detector_metrics200_response_summary_class_counts.py
+groundlight_openapi_client/models/image_query.py
+groundlight_openapi_client/models/image_query_result.py
+groundlight_openapi_client/models/image_query_type_enum.py
+groundlight_openapi_client/models/label.py
+groundlight_openapi_client/models/label_value.py
+groundlight_openapi_client/models/label_value_request.py
+groundlight_openapi_client/models/mode_enum.py
+groundlight_openapi_client/models/multi_class_mode_configuration.py
+groundlight_openapi_client/models/multi_classification_result.py
+groundlight_openapi_client/models/note.py
+groundlight_openapi_client/models/note_request.py
+groundlight_openapi_client/models/paginated_detector_list.py
+groundlight_openapi_client/models/paginated_image_query_list.py
+groundlight_openapi_client/models/paginated_rule_list.py
+groundlight_openapi_client/models/patched_detector_request.py
+groundlight_openapi_client/models/payload_template.py
+groundlight_openapi_client/models/payload_template_request.py
+groundlight_openapi_client/models/result_type_enum.py
+groundlight_openapi_client/models/roi.py
+groundlight_openapi_client/models/roi_request.py
+groundlight_openapi_client/models/rule.py
+groundlight_openapi_client/models/rule_action.py
+groundlight_openapi_client/models/rule_request.py
+groundlight_openapi_client/models/snooze_time_unit_enum.py
+groundlight_openapi_client/models/source.py
+groundlight_openapi_client/models/source_enum.py
+groundlight_openapi_client/models/status_enum.py
+groundlight_openapi_client/models/text_mode_configuration.py
+groundlight_openapi_client/models/text_recognition_result.py
+groundlight_openapi_client/models/verb_enum.py
+groundlight_openapi_client/models/webhook_action.py
+groundlight_openapi_client/models/webhook_action_request.py
+groundlight_openapi_client/models/who_am_i200_response.py
+groundlight_openapi_client/py.typed
groundlight_openapi_client/rest.py
+pyproject.toml
requirements.txt
setup.cfg
setup.py
test-requirements.txt
test/__init__.py
-test/test_label.py
-test/test_source.py
tox.ini
diff --git a/generated/.openapi-generator/VERSION b/generated/.openapi-generator/VERSION
index 1e20ec35..eb1dc6a5 100644
--- a/generated/.openapi-generator/VERSION
+++ b/generated/.openapi-generator/VERSION
@@ -1 +1 @@
-5.4.0
\ No newline at end of file
+7.13.0
diff --git a/generated/README.md b/generated/README.md
index f82c9211..313a0f58 100644
--- a/generated/README.md
+++ b/generated/README.md
@@ -5,11 +5,12 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
- API version: 0.18.2
- Package version: 1.0.0
-- Build package: org.openapitools.codegen.languages.PythonClientCodegen
+- Generator version: 7.13.0
+- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen
## Requirements.
-Python >=3.6
+Python 3.7+
## Installation & Usage
### pip install
@@ -40,6 +41,10 @@ Then import the package:
import groundlight_openapi_client
```
+### Tests
+
+Execute `pytest` to run the tests.
+
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
@@ -48,11 +53,9 @@ Please follow the [installation procedure](#installation--usage) and then run th
import time
import groundlight_openapi_client
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
-from groundlight_openapi_client.api import actions_api
-from groundlight_openapi_client.model.paginated_rule_list import PaginatedRuleList
-from groundlight_openapi_client.model.rule import Rule
-from groundlight_openapi_client.model.rule_request import RuleRequest
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -65,7 +68,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -74,39 +77,17 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = actions_api.ActionsApi(api_client)
- detector_id = "detector_id_example" # str |
-rule_request = RuleRequest(
- name="name_example",
- enabled=True,
- snooze_time_enabled=False,
- snooze_time_value=0,
- snooze_time_unit=None,
- human_review_required=False,
- condition=ConditionRequest(
- verb="verb_example",
- parameters={
- "key": None,
- },
- ),
- action=None,
- webhook_action=[
- WebhookActionRequest(
- url="url_example",
- include_image=True,
- payload_template=None,
- last_message_failed=True,
- last_failure_error="last_failure_error_example",
- last_failed_at=dateutil_parser('1970-01-01T00:00:00.00Z'),
- ),
- ],
- ) # RuleRequest |
+ api_instance = groundlight_openapi_client.ActionsApi(api_client)
+ detector_id = 'detector_id_example' # str |
+ rule_request = groundlight_openapi_client.RuleRequest() # RuleRequest |
try:
api_response = api_instance.create_rule(detector_id, rule_request)
+ print("The response of ActionsApi->create_rule:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except ApiException as e:
print("Exception when calling ActionsApi->create_rule: %s\n" % e)
+
```
## Documentation for API Endpoints
@@ -145,7 +126,6 @@ Class | Method | HTTP request | Description
## Documentation For Models
- [Action](docs/Action.md)
- - [ActionList](docs/ActionList.md)
- [AllNotes](docs/AllNotes.md)
- [AnnotationsRequestedEnum](docs/AnnotationsRequestedEnum.md)
- [BBoxGeometry](docs/BBoxGeometry.md)
@@ -161,19 +141,21 @@ Class | Method | HTTP request | Description
- [CountingResult](docs/CountingResult.md)
- [Detector](docs/Detector.md)
- [DetectorCreationInputRequest](docs/DetectorCreationInputRequest.md)
+ - [DetectorCreationInputRequestModeConfiguration](docs/DetectorCreationInputRequestModeConfiguration.md)
- [DetectorGroup](docs/DetectorGroup.md)
- [DetectorGroupRequest](docs/DetectorGroupRequest.md)
+ - [DetectorStatus](docs/DetectorStatus.md)
- [DetectorTypeEnum](docs/DetectorTypeEnum.md)
- [EdgeModelInfo](docs/EdgeModelInfo.md)
- [EscalationTypeEnum](docs/EscalationTypeEnum.md)
+ - [GetDetectorEvaluation200Response](docs/GetDetectorEvaluation200Response.md)
+ - [GetDetectorEvaluation200ResponseEvaluationResults](docs/GetDetectorEvaluation200ResponseEvaluationResults.md)
+ - [GetDetectorMetrics200Response](docs/GetDetectorMetrics200Response.md)
+ - [GetDetectorMetrics200ResponseSummary](docs/GetDetectorMetrics200ResponseSummary.md)
+ - [GetDetectorMetrics200ResponseSummaryClassCounts](docs/GetDetectorMetrics200ResponseSummaryClassCounts.md)
- [ImageQuery](docs/ImageQuery.md)
+ - [ImageQueryResult](docs/ImageQueryResult.md)
- [ImageQueryTypeEnum](docs/ImageQueryTypeEnum.md)
- - [InlineResponse200](docs/InlineResponse200.md)
- - [InlineResponse2001](docs/InlineResponse2001.md)
- - [InlineResponse2001EvaluationResults](docs/InlineResponse2001EvaluationResults.md)
- - [InlineResponse2002](docs/InlineResponse2002.md)
- - [InlineResponse200Summary](docs/InlineResponse200Summary.md)
- - [InlineResponse200SummaryClassCounts](docs/InlineResponse200SummaryClassCounts.md)
- [Label](docs/Label.md)
- [LabelValue](docs/LabelValue.md)
- [LabelValueRequest](docs/LabelValueRequest.md)
@@ -192,6 +174,7 @@ Class | Method | HTTP request | Description
- [ROIRequest](docs/ROIRequest.md)
- [ResultTypeEnum](docs/ResultTypeEnum.md)
- [Rule](docs/Rule.md)
+ - [RuleAction](docs/RuleAction.md)
- [RuleRequest](docs/RuleRequest.md)
- [SnoozeTimeUnitEnum](docs/SnoozeTimeUnitEnum.md)
- [Source](docs/Source.md)
@@ -202,12 +185,16 @@ Class | Method | HTTP request | Description
- [VerbEnum](docs/VerbEnum.md)
- [WebhookAction](docs/WebhookAction.md)
- [WebhookActionRequest](docs/WebhookActionRequest.md)
+ - [WhoAmI200Response](docs/WhoAmI200Response.md)
+
## Documentation For Authorization
-## ApiToken
+Authentication schemes defined for the API:
+
+### ApiToken
- **Type**: API key
- **API key parameter name**: x-api-token
@@ -219,22 +206,3 @@ Class | Method | HTTP request | Description
support@groundlight.ai
-## Notes for Large OpenAPI documents
-If the OpenAPI document is large, imports in groundlight_openapi_client.apis and groundlight_openapi_client.models may fail with a
-RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
-
-Solution 1:
-Use specific imports for apis and models like:
-- `from groundlight_openapi_client.api.default_api import DefaultApi`
-- `from groundlight_openapi_client.model.pet import Pet`
-
-Solution 2:
-Before importing the package, adjust the maximum recursion limit as shown below:
-```
-import sys
-sys.setrecursionlimit(1500)
-import groundlight_openapi_client
-from groundlight_openapi_client.apis import *
-from groundlight_openapi_client.models import *
-```
-
diff --git a/generated/docs/Action.md b/generated/docs/Action.md
index 0eee9350..e3e5982e 100644
--- a/generated/docs/Action.md
+++ b/generated/docs/Action.md
@@ -7,8 +7,24 @@ Name | Type | Description | Notes
**channel** | [**ChannelEnum**](ChannelEnum.md) | |
**recipient** | **str** | |
**include_image** | **bool** | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.action import Action
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Action from a JSON string
+action_instance = Action.from_json(json)
+# print the JSON string representation of the object
+print Action.to_json()
+
+# convert the object into a dict
+action_dict = action_instance.to_dict()
+# create an instance of Action from a dict
+action_from_dict = Action.from_dict(action_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/ActionList.md b/generated/docs/ActionList.md
index 10624be3..c4c8528f 100644
--- a/generated/docs/ActionList.md
+++ b/generated/docs/ActionList.md
@@ -1,11 +1,8 @@
# ActionList
-
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | [**[Action]**](Action.md) | |
+Type | Description | Notes
+------------- | ------------- | -------------
+**[Action]** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/generated/docs/ActionsApi.md b/generated/docs/ActionsApi.md
index 099d468f..84811dcf 100644
--- a/generated/docs/ActionsApi.md
+++ b/generated/docs/ActionsApi.md
@@ -21,14 +21,15 @@ Create a new rule for a detector
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import actions_api
-from groundlight_openapi_client.model.rule import Rule
-from groundlight_openapi_client.model.rule_request import RuleRequest
+from groundlight_openapi_client.models.rule import Rule
+from groundlight_openapi_client.models.rule_request import RuleRequest
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -41,7 +42,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -49,49 +50,26 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = actions_api.ActionsApi(api_client)
- detector_id = "detector_id_example" # str |
- rule_request = RuleRequest(
- name="name_example",
- enabled=True,
- snooze_time_enabled=False,
- snooze_time_value=0,
- snooze_time_unit=None,
- human_review_required=False,
- condition=ConditionRequest(
- verb="verb_example",
- parameters={
- "key": None,
- },
- ),
- action=None,
- webhook_action=[
- WebhookActionRequest(
- url="url_example",
- include_image=True,
- payload_template=None,
- last_message_failed=True,
- last_failure_error="last_failure_error_example",
- last_failed_at=dateutil_parser('1970-01-01T00:00:00.00Z'),
- ),
- ],
- ) # RuleRequest |
-
- # example passing only required values which don't have defaults set
+ api_instance = groundlight_openapi_client.ActionsApi(api_client)
+ detector_id = 'detector_id_example' # str |
+ rule_request = groundlight_openapi_client.RuleRequest() # RuleRequest |
+
try:
api_response = api_instance.create_rule(detector_id, rule_request)
+ print("The response of ActionsApi->create_rule:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ActionsApi->create_rule: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| |
- **rule_request** | [**RuleRequest**](RuleRequest.md)| |
+ **detector_id** | **str**| |
+ **rule_request** | [**RuleRequest**](RuleRequest.md)| |
### Return type
@@ -106,9 +84,7 @@ Name | Type | Description | Notes
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | | - |
@@ -125,12 +101,13 @@ Delete a rule
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import actions_api
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -143,7 +120,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -151,22 +128,22 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = actions_api.ActionsApi(api_client)
- id = 1 # int |
+ api_instance = groundlight_openapi_client.ActionsApi(api_client)
+ id = 56 # int |
- # example passing only required values which don't have defaults set
try:
api_instance.delete_rule(id)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ActionsApi->delete_rule: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **int**| |
+ **id** | **int**| |
### Return type
@@ -181,9 +158,7 @@ void (empty response body)
- **Content-Type**: Not defined
- **Accept**: Not defined
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No response body | - |
@@ -200,13 +175,14 @@ Retrieve a rule
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import actions_api
-from groundlight_openapi_client.model.rule import Rule
+from groundlight_openapi_client.models.rule import Rule
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -219,7 +195,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -227,23 +203,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = actions_api.ActionsApi(api_client)
- id = 1 # int |
+ api_instance = groundlight_openapi_client.ActionsApi(api_client)
+ id = 56 # int |
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_rule(id)
+ print("The response of ActionsApi->get_rule:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ActionsApi->get_rule: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **int**| |
+ **id** | **int**| |
### Return type
@@ -258,9 +235,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -268,7 +243,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **list_detector_rules**
-> PaginatedRuleList list_detector_rules(detector_id)
+> PaginatedRuleList list_detector_rules(detector_id, page=page, page_size=page_size)
@@ -277,13 +252,14 @@ List all rules for a detector
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import actions_api
-from groundlight_openapi_client.model.paginated_rule_list import PaginatedRuleList
+from groundlight_openapi_client.models.paginated_rule_list import PaginatedRuleList
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -296,7 +272,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -304,35 +280,28 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = actions_api.ActionsApi(api_client)
- detector_id = "detector_id_example" # str |
- page = 1 # int | A page number within the paginated result set. (optional)
- page_size = 1 # int | Number of results to return per page. (optional)
-
- # example passing only required values which don't have defaults set
- try:
- api_response = api_instance.list_detector_rules(detector_id)
- pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
- print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e)
+ api_instance = groundlight_openapi_client.ActionsApi(api_client)
+ detector_id = 'detector_id_example' # str |
+ page = 56 # int | A page number within the paginated result set. (optional)
+ page_size = 56 # int | Number of results to return per page. (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
api_response = api_instance.list_detector_rules(detector_id, page=page, page_size=page_size)
+ print("The response of ActionsApi->list_detector_rules:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| |
- **page** | **int**| A page number within the paginated result set. | [optional]
- **page_size** | **int**| Number of results to return per page. | [optional]
+ **detector_id** | **str**| |
+ **page** | **int**| A page number within the paginated result set. | [optional]
+ **page_size** | **int**| Number of results to return per page. | [optional]
### Return type
@@ -347,9 +316,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -357,7 +324,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **list_rules**
-> PaginatedRuleList list_rules()
+> PaginatedRuleList list_rules(page=page, page_size=page_size)
@@ -366,13 +333,14 @@ Lists all rules over all detectors owned by the requester.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import actions_api
-from groundlight_openapi_client.model.paginated_rule_list import PaginatedRuleList
+from groundlight_openapi_client.models.paginated_rule_list import PaginatedRuleList
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -385,7 +353,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -393,26 +361,26 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = actions_api.ActionsApi(api_client)
- page = 1 # int | A page number within the paginated result set. (optional)
- page_size = 1 # int | Number of results to return per page. (optional)
+ api_instance = groundlight_openapi_client.ActionsApi(api_client)
+ page = 56 # int | A page number within the paginated result set. (optional)
+ page_size = 56 # int | Number of results to return per page. (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
api_response = api_instance.list_rules(page=page, page_size=page_size)
+ print("The response of ActionsApi->list_rules:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ActionsApi->list_rules: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **page** | **int**| A page number within the paginated result set. | [optional]
- **page_size** | **int**| Number of results to return per page. | [optional]
+ **page** | **int**| A page number within the paginated result set. | [optional]
+ **page_size** | **int**| Number of results to return per page. | [optional]
### Return type
@@ -427,9 +395,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
diff --git a/generated/docs/AllNotes.md b/generated/docs/AllNotes.md
index f14d4ea6..71957a6f 100644
--- a/generated/docs/AllNotes.md
+++ b/generated/docs/AllNotes.md
@@ -5,10 +5,26 @@ Serializes all notes for a given detector, grouped by type as listed in UserProf
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**customer** | [**[Note]**](Note.md) | |
-**gl** | [**[Note]**](Note.md) | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**customer** | [**List[Note]**](Note.md) | |
+**gl** | [**List[Note]**](Note.md) | |
+## Example
+
+```python
+from groundlight_openapi_client.models.all_notes import AllNotes
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of AllNotes from a JSON string
+all_notes_instance = AllNotes.from_json(json)
+# print the JSON string representation of the object
+print AllNotes.to_json()
+
+# convert the object into a dict
+all_notes_dict = all_notes_instance.to_dict()
+# create an instance of AllNotes from a dict
+all_notes_from_dict = AllNotes.from_dict(all_notes_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/AnnotationsRequestedEnum.md b/generated/docs/AnnotationsRequestedEnum.md
index 31b444e4..668a7a47 100644
--- a/generated/docs/AnnotationsRequestedEnum.md
+++ b/generated/docs/AnnotationsRequestedEnum.md
@@ -1,10 +1,11 @@
# AnnotationsRequestedEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ]
+## Enum
+
+* `BINARY_CLASSIFICATION` (value: `'BINARY_CLASSIFICATION'`)
+
+* `BOUNDING_BOXES` (value: `'BOUNDING_BOXES'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/BBoxGeometry.md b/generated/docs/BBoxGeometry.md
index 432bb48c..4b527dd5 100644
--- a/generated/docs/BBoxGeometry.md
+++ b/generated/docs/BBoxGeometry.md
@@ -11,8 +11,24 @@ Name | Type | Description | Notes
**bottom** | **float** | |
**x** | **float** | | [readonly]
**y** | **float** | | [readonly]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.b_box_geometry import BBoxGeometry
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BBoxGeometry from a JSON string
+b_box_geometry_instance = BBoxGeometry.from_json(json)
+# print the JSON string representation of the object
+print BBoxGeometry.to_json()
+
+# convert the object into a dict
+b_box_geometry_dict = b_box_geometry_instance.to_dict()
+# create an instance of BBoxGeometry from a dict
+b_box_geometry_from_dict = BBoxGeometry.from_dict(b_box_geometry_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/BBoxGeometryRequest.md b/generated/docs/BBoxGeometryRequest.md
index 93432d84..01766e28 100644
--- a/generated/docs/BBoxGeometryRequest.md
+++ b/generated/docs/BBoxGeometryRequest.md
@@ -9,8 +9,24 @@ Name | Type | Description | Notes
**top** | **float** | |
**right** | **float** | |
**bottom** | **float** | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.b_box_geometry_request import BBoxGeometryRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BBoxGeometryRequest from a JSON string
+b_box_geometry_request_instance = BBoxGeometryRequest.from_json(json)
+# print the JSON string representation of the object
+print BBoxGeometryRequest.to_json()
+
+# convert the object into a dict
+b_box_geometry_request_dict = b_box_geometry_request_instance.to_dict()
+# create an instance of BBoxGeometryRequest from a dict
+b_box_geometry_request_from_dict = BBoxGeometryRequest.from_dict(b_box_geometry_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/BinaryClassificationResult.md b/generated/docs/BinaryClassificationResult.md
index a98a3b70..fa844263 100644
--- a/generated/docs/BinaryClassificationResult.md
+++ b/generated/docs/BinaryClassificationResult.md
@@ -4,13 +4,29 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**label** | **str** | |
-**confidence** | **float, none_type** | | [optional]
+**confidence** | **float** | | [optional]
**source** | **str** | | [optional]
-**result_type** | **str** | | [optional] if omitted the server will use the default value of "binary_classification"
+**result_type** | **str** | | [optional]
**from_edge** | **bool** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**label** | **str** | |
+
+## Example
+
+```python
+from groundlight_openapi_client.models.binary_classification_result import BinaryClassificationResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BinaryClassificationResult from a JSON string
+binary_classification_result_instance = BinaryClassificationResult.from_json(json)
+# print the JSON string representation of the object
+print BinaryClassificationResult.to_json()
+# convert the object into a dict
+binary_classification_result_dict = binary_classification_result_instance.to_dict()
+# create an instance of BinaryClassificationResult from a dict
+binary_classification_result_from_dict = BinaryClassificationResult.from_dict(binary_classification_result_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/BlankEnum.md b/generated/docs/BlankEnum.md
index 1531f56d..569c6616 100644
--- a/generated/docs/BlankEnum.md
+++ b/generated/docs/BlankEnum.md
@@ -1,10 +1,9 @@
# BlankEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | defaults to "", must be one of ["", ]
+## Enum
+
+* `EMPTY` (value: `''`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/BoundingBoxModeConfiguration.md b/generated/docs/BoundingBoxModeConfiguration.md
index 5a27bed3..7c6b4c18 100644
--- a/generated/docs/BoundingBoxModeConfiguration.md
+++ b/generated/docs/BoundingBoxModeConfiguration.md
@@ -6,8 +6,24 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**class_name** | **str** | |
**max_num_bboxes** | **int** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.bounding_box_mode_configuration import BoundingBoxModeConfiguration
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BoundingBoxModeConfiguration from a JSON string
+bounding_box_mode_configuration_instance = BoundingBoxModeConfiguration.from_json(json)
+# print the JSON string representation of the object
+print BoundingBoxModeConfiguration.to_json()
+
+# convert the object into a dict
+bounding_box_mode_configuration_dict = bounding_box_mode_configuration_instance.to_dict()
+# create an instance of BoundingBoxModeConfiguration from a dict
+bounding_box_mode_configuration_from_dict = BoundingBoxModeConfiguration.from_dict(bounding_box_mode_configuration_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/BoundingBoxResult.md b/generated/docs/BoundingBoxResult.md
index 7a089d95..d51b1f0e 100644
--- a/generated/docs/BoundingBoxResult.md
+++ b/generated/docs/BoundingBoxResult.md
@@ -4,13 +4,29 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**label** | **str** | |
-**confidence** | **float, none_type** | | [optional]
+**confidence** | **float** | | [optional]
**source** | **str** | | [optional]
-**result_type** | **str** | | [optional] if omitted the server will use the default value of "bounding_box"
+**result_type** | **str** | | [optional]
**from_edge** | **bool** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**label** | **str** | |
+
+## Example
+
+```python
+from groundlight_openapi_client.models.bounding_box_result import BoundingBoxResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of BoundingBoxResult from a JSON string
+bounding_box_result_instance = BoundingBoxResult.from_json(json)
+# print the JSON string representation of the object
+print BoundingBoxResult.to_json()
+# convert the object into a dict
+bounding_box_result_dict = bounding_box_result_instance.to_dict()
+# create an instance of BoundingBoxResult from a dict
+bounding_box_result_from_dict = BoundingBoxResult.from_dict(bounding_box_result_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/ChannelEnum.md b/generated/docs/ChannelEnum.md
index f0dcfeaa..7b82d2a1 100644
--- a/generated/docs/ChannelEnum.md
+++ b/generated/docs/ChannelEnum.md
@@ -1,10 +1,11 @@
# ChannelEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["TEXT", "EMAIL", ]
+## Enum
+
+* `TEXT` (value: `'TEXT'`)
+
+* `EMAIL` (value: `'EMAIL'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/Condition.md b/generated/docs/Condition.md
index e54e1ad5..6274a91e 100644
--- a/generated/docs/Condition.md
+++ b/generated/docs/Condition.md
@@ -5,9 +5,25 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**verb** | **str** | |
-**parameters** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**parameters** | **Dict[str, object]** | |
+## Example
+
+```python
+from groundlight_openapi_client.models.condition import Condition
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Condition from a JSON string
+condition_instance = Condition.from_json(json)
+# print the JSON string representation of the object
+print Condition.to_json()
+
+# convert the object into a dict
+condition_dict = condition_instance.to_dict()
+# create an instance of Condition from a dict
+condition_from_dict = Condition.from_dict(condition_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/ConditionRequest.md b/generated/docs/ConditionRequest.md
index 60a6d034..8a95f21a 100644
--- a/generated/docs/ConditionRequest.md
+++ b/generated/docs/ConditionRequest.md
@@ -5,9 +5,25 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**verb** | **str** | |
-**parameters** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**parameters** | **Dict[str, object]** | |
+## Example
+
+```python
+from groundlight_openapi_client.models.condition_request import ConditionRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ConditionRequest from a JSON string
+condition_request_instance = ConditionRequest.from_json(json)
+# print the JSON string representation of the object
+print ConditionRequest.to_json()
+
+# convert the object into a dict
+condition_request_dict = condition_request_instance.to_dict()
+# create an instance of ConditionRequest from a dict
+condition_request_from_dict = ConditionRequest.from_dict(condition_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/CountModeConfiguration.md b/generated/docs/CountModeConfiguration.md
index 0262ae0a..a9352295 100644
--- a/generated/docs/CountModeConfiguration.md
+++ b/generated/docs/CountModeConfiguration.md
@@ -4,10 +4,26 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**class_name** | **str** | |
**max_count** | **int** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**class_name** | **str** | |
+
+## Example
+
+```python
+from groundlight_openapi_client.models.count_mode_configuration import CountModeConfiguration
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CountModeConfiguration from a JSON string
+count_mode_configuration_instance = CountModeConfiguration.from_json(json)
+# print the JSON string representation of the object
+print CountModeConfiguration.to_json()
+# convert the object into a dict
+count_mode_configuration_dict = count_mode_configuration_instance.to_dict()
+# create an instance of CountModeConfiguration from a dict
+count_mode_configuration_from_dict = CountModeConfiguration.from_dict(count_mode_configuration_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/CountingResult.md b/generated/docs/CountingResult.md
index f9db3d5d..9ffdfb50 100644
--- a/generated/docs/CountingResult.md
+++ b/generated/docs/CountingResult.md
@@ -4,14 +4,30 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**count** | **int, none_type** | |
-**confidence** | **float, none_type** | | [optional]
+**confidence** | **float** | | [optional]
**source** | **str** | | [optional]
-**result_type** | **str** | | [optional] if omitted the server will use the default value of "counting"
+**result_type** | **str** | | [optional]
**from_edge** | **bool** | | [optional]
+**count** | **int** | |
**greater_than_max** | **bool** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.counting_result import CountingResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of CountingResult from a JSON string
+counting_result_instance = CountingResult.from_json(json)
+# print the JSON string representation of the object
+print CountingResult.to_json()
+
+# convert the object into a dict
+counting_result_dict = counting_result_instance.to_dict()
+# create an instance of CountingResult from a dict
+counting_result_from_dict = CountingResult.from_dict(counting_result_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/Detector.md b/generated/docs/Detector.md
index b2f9f86e..9536ea1e 100644
--- a/generated/docs/Detector.md
+++ b/generated/docs/Detector.md
@@ -6,20 +6,36 @@ Groundlight Detectors provide answers to natural language questions about images
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | A unique ID for this object. | [readonly]
-**type** | **bool, date, datetime, dict, float, int, list, str, none_type** | The type of this object. | [readonly]
+**type** | [**DetectorTypeEnum**](DetectorTypeEnum.md) | The type of this object. | [readonly]
**created_at** | **datetime** | When this detector was created. | [readonly]
**name** | **str** | A short, descriptive name for the detector. |
**query** | **str** | A question about the image. | [readonly]
**group_name** | **str** | Which group should this detector be part of? | [readonly]
-**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Metadata about the detector. | [readonly]
+**confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] [default to 0.9]
+**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] [default to 30.0]
+**metadata** | **Dict[str, object]** | Metadata about the detector. | [readonly]
**mode** | **str** | | [readonly]
-**mode_configuration** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [readonly]
-**confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] if omitted the server will use the default value of 0.9
-**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] if omitted the server will use the default value of 30.0
-**status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
+**mode_configuration** | **Dict[str, object]** | | [readonly]
+**status** | [**DetectorStatus**](DetectorStatus.md) | | [optional]
**escalation_type** | **str** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.detector import Detector
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Detector from a JSON string
+detector_instance = Detector.from_json(json)
+# print the JSON string representation of the object
+print Detector.to_json()
+
+# convert the object into a dict
+detector_dict = detector_instance.to_dict()
+# create an instance of Detector from a dict
+detector_from_dict = Detector.from_dict(detector_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/DetectorCreationInputRequest.md b/generated/docs/DetectorCreationInputRequest.md
index 16adba94..240c86e4 100644
--- a/generated/docs/DetectorCreationInputRequest.md
+++ b/generated/docs/DetectorCreationInputRequest.md
@@ -8,14 +8,30 @@ Name | Type | Description | Notes
**name** | **str** | A short, descriptive name for the detector. |
**query** | **str** | A question about the image. |
**group_name** | **str** | Which group should this detector be part of? | [optional]
-**confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] if omitted the server will use the default value of 0.9
-**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] if omitted the server will use the default value of 30.0
-**pipeline_config** | **str, none_type** | (Advanced usage) Configuration needed to instantiate a prediction pipeline. | [optional]
+**confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] [default to 0.9]
+**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] [default to 30.0]
+**pipeline_config** | **str** | (Advanced usage) Configuration needed to instantiate a prediction pipeline. | [optional]
**metadata** | **str** | Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding. | [optional]
-**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX | [optional]
-**mode_configuration** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**mode** | [**ModeEnum**](ModeEnum.md) | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX | [optional]
+**mode_configuration** | [**DetectorCreationInputRequestModeConfiguration**](DetectorCreationInputRequestModeConfiguration.md) | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.detector_creation_input_request import DetectorCreationInputRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DetectorCreationInputRequest from a JSON string
+detector_creation_input_request_instance = DetectorCreationInputRequest.from_json(json)
+# print the JSON string representation of the object
+print DetectorCreationInputRequest.to_json()
+
+# convert the object into a dict
+detector_creation_input_request_dict = detector_creation_input_request_instance.to_dict()
+# create an instance of DetectorCreationInputRequest from a dict
+detector_creation_input_request_from_dict = DetectorCreationInputRequest.from_dict(detector_creation_input_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/DetectorCreationInputRequestModeConfiguration.md b/generated/docs/DetectorCreationInputRequestModeConfiguration.md
new file mode 100644
index 00000000..f4f72b21
--- /dev/null
+++ b/generated/docs/DetectorCreationInputRequestModeConfiguration.md
@@ -0,0 +1,33 @@
+# DetectorCreationInputRequestModeConfiguration
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**max_count** | **int** | | [optional]
+**class_name** | **str** | |
+**class_names** | **List[str]** | |
+**num_classes** | **int** | | [optional]
+**value_max_length** | **int** | | [optional]
+**max_num_bboxes** | **int** | | [optional]
+
+## Example
+
+```python
+from groundlight_openapi_client.models.detector_creation_input_request_mode_configuration import DetectorCreationInputRequestModeConfiguration
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DetectorCreationInputRequestModeConfiguration from a JSON string
+detector_creation_input_request_mode_configuration_instance = DetectorCreationInputRequestModeConfiguration.from_json(json)
+# print the JSON string representation of the object
+print DetectorCreationInputRequestModeConfiguration.to_json()
+
+# convert the object into a dict
+detector_creation_input_request_mode_configuration_dict = detector_creation_input_request_mode_configuration_instance.to_dict()
+# create an instance of DetectorCreationInputRequestModeConfiguration from a dict
+detector_creation_input_request_mode_configuration_from_dict = DetectorCreationInputRequestModeConfiguration.from_dict(detector_creation_input_request_mode_configuration_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/DetectorGroup.md b/generated/docs/DetectorGroup.md
index c1f764be..a68e2447 100644
--- a/generated/docs/DetectorGroup.md
+++ b/generated/docs/DetectorGroup.md
@@ -6,8 +6,24 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | | [readonly]
**name** | **str** | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.detector_group import DetectorGroup
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DetectorGroup from a JSON string
+detector_group_instance = DetectorGroup.from_json(json)
+# print the JSON string representation of the object
+print DetectorGroup.to_json()
+
+# convert the object into a dict
+detector_group_dict = detector_group_instance.to_dict()
+# create an instance of DetectorGroup from a dict
+detector_group_from_dict = DetectorGroup.from_dict(detector_group_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/DetectorGroupRequest.md b/generated/docs/DetectorGroupRequest.md
index 8de4ad8a..808f5d4e 100644
--- a/generated/docs/DetectorGroupRequest.md
+++ b/generated/docs/DetectorGroupRequest.md
@@ -5,8 +5,24 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.detector_group_request import DetectorGroupRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DetectorGroupRequest from a JSON string
+detector_group_request_instance = DetectorGroupRequest.from_json(json)
+# print the JSON string representation of the object
+print DetectorGroupRequest.to_json()
+
+# convert the object into a dict
+detector_group_request_dict = detector_group_request_instance.to_dict()
+# create an instance of DetectorGroupRequest from a dict
+detector_group_request_from_dict = DetectorGroupRequest.from_dict(detector_group_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/DetectorGroupsApi.md b/generated/docs/DetectorGroupsApi.md
index 27212d12..ec1f734f 100644
--- a/generated/docs/DetectorGroupsApi.md
+++ b/generated/docs/DetectorGroupsApi.md
@@ -13,19 +13,24 @@ Method | HTTP request | Description
-Create a new detector group POST data: Required: - name (str) - name of the predictor set
+Create a new detector group
+
+POST data:
+ Required:
+ - name (str) - name of the predictor set
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detector_groups_api
-from groundlight_openapi_client.model.detector_group_request import DetectorGroupRequest
-from groundlight_openapi_client.model.detector_group import DetectorGroup
+from groundlight_openapi_client.models.detector_group import DetectorGroup
+from groundlight_openapi_client.models.detector_group_request import DetectorGroupRequest
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -38,7 +43,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -46,25 +51,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detector_groups_api.DetectorGroupsApi(api_client)
- detector_group_request = DetectorGroupRequest(
- name="name_example",
- ) # DetectorGroupRequest |
+ api_instance = groundlight_openapi_client.DetectorGroupsApi(api_client)
+ detector_group_request = groundlight_openapi_client.DetectorGroupRequest() # DetectorGroupRequest |
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.create_detector_group(detector_group_request)
+ print("The response of DetectorGroupsApi->create_detector_group:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorGroupsApi->create_detector_group: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_group_request** | [**DetectorGroupRequest**](DetectorGroupRequest.md)| |
+ **detector_group_request** | [**DetectorGroupRequest**](DetectorGroupRequest.md)| |
### Return type
@@ -79,9 +83,7 @@ Name | Type | Description | Notes
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | | - |
@@ -89,7 +91,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_detector_groups**
-> [DetectorGroup] get_detector_groups()
+> List[DetectorGroup] get_detector_groups()
@@ -98,13 +100,14 @@ List all detector groups
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detector_groups_api
-from groundlight_openapi_client.model.detector_group import DetectorGroup
+from groundlight_openapi_client.models.detector_group import DetectorGroup
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -117,7 +120,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -125,23 +128,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detector_groups_api.DetectorGroupsApi(api_client)
+ api_instance = groundlight_openapi_client.DetectorGroupsApi(api_client)
- # example, this endpoint has no required or optional parameters
try:
api_response = api_instance.get_detector_groups()
+ print("The response of DetectorGroupsApi->get_detector_groups:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorGroupsApi->get_detector_groups: %s\n" % e)
```
+
### Parameters
This endpoint does not need any parameter.
### Return type
-[**[DetectorGroup]**](DetectorGroup.md)
+[**List[DetectorGroup]**](DetectorGroup.md)
### Authorization
@@ -152,9 +156,7 @@ This endpoint does not need any parameter.
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
diff --git a/generated/docs/DetectorResetApi.md b/generated/docs/DetectorResetApi.md
index 087d781c..e91992b3 100644
--- a/generated/docs/DetectorResetApi.md
+++ b/generated/docs/DetectorResetApi.md
@@ -17,12 +17,13 @@ Deletes all image queries on the detector
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detector_reset_api
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -35,7 +36,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -43,22 +44,22 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detector_reset_api.DetectorResetApi(api_client)
- id = "id_example" # str |
+ api_instance = groundlight_openapi_client.DetectorResetApi(api_client)
+ id = 'id_example' # str |
- # example passing only required values which don't have defaults set
try:
api_instance.reset_detector(id)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorResetApi->reset_detector: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **str**| |
+ **id** | **str**| |
### Return type
@@ -73,9 +74,7 @@ void (empty response body)
- **Content-Type**: Not defined
- **Accept**: Not defined
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No response body | - |
diff --git a/generated/docs/DetectorStatus.md b/generated/docs/DetectorStatus.md
new file mode 100644
index 00000000..a99c9542
--- /dev/null
+++ b/generated/docs/DetectorStatus.md
@@ -0,0 +1,27 @@
+# DetectorStatus
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+
+## Example
+
+```python
+from groundlight_openapi_client.models.detector_status import DetectorStatus
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of DetectorStatus from a JSON string
+detector_status_instance = DetectorStatus.from_json(json)
+# print the JSON string representation of the object
+print DetectorStatus.to_json()
+
+# convert the object into a dict
+detector_status_dict = detector_status_instance.to_dict()
+# create an instance of DetectorStatus from a dict
+detector_status_from_dict = DetectorStatus.from_dict(detector_status_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/DetectorTypeEnum.md b/generated/docs/DetectorTypeEnum.md
index 36a12ea5..4a2480d3 100644
--- a/generated/docs/DetectorTypeEnum.md
+++ b/generated/docs/DetectorTypeEnum.md
@@ -1,10 +1,9 @@
# DetectorTypeEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | defaults to "detector", must be one of ["detector", ]
+## Enum
+
+* `DETECTOR` (value: `'detector'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/DetectorsApi.md b/generated/docs/DetectorsApi.md
index 9f5355e5..0acb7425 100644
--- a/generated/docs/DetectorsApi.md
+++ b/generated/docs/DetectorsApi.md
@@ -23,14 +23,15 @@ Create a new detector.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detectors_api
-from groundlight_openapi_client.model.detector_creation_input_request import DetectorCreationInputRequest
-from groundlight_openapi_client.model.detector import Detector
+from groundlight_openapi_client.models.detector import Detector
+from groundlight_openapi_client.models.detector_creation_input_request import DetectorCreationInputRequest
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -43,7 +44,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -51,33 +52,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detectors_api.DetectorsApi(api_client)
- detector_creation_input_request = DetectorCreationInputRequest(
- name="name_example",
- query="query_example",
- group_name="group_name_example",
- confidence_threshold=0.9,
- patience_time=30.0,
- pipeline_config="pipeline_config_example",
- metadata="metadata_example",
- mode=None,
- mode_configuration=None,
- ) # DetectorCreationInputRequest |
-
- # example passing only required values which don't have defaults set
+ api_instance = groundlight_openapi_client.DetectorsApi(api_client)
+ detector_creation_input_request = groundlight_openapi_client.DetectorCreationInputRequest() # DetectorCreationInputRequest |
+
try:
api_response = api_instance.create_detector(detector_creation_input_request)
+ print("The response of DetectorsApi->create_detector:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorsApi->create_detector: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_creation_input_request** | [**DetectorCreationInputRequest**](DetectorCreationInputRequest.md)| |
+ **detector_creation_input_request** | [**DetectorCreationInputRequest**](DetectorCreationInputRequest.md)| |
### Return type
@@ -92,9 +84,7 @@ Name | Type | Description | Notes
- **Content-Type**: application/json
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | | - |
@@ -111,12 +101,13 @@ Delete a detector by its ID.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detectors_api
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -129,7 +120,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -137,22 +128,22 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detectors_api.DetectorsApi(api_client)
- id = "id_example" # str | Choose a detector by its ID.
+ api_instance = groundlight_openapi_client.DetectorsApi(api_client)
+ id = 'id_example' # str | Choose a detector by its ID.
- # example passing only required values which don't have defaults set
try:
api_instance.delete_detector(id)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorsApi->delete_detector: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **str**| Choose a detector by its ID. |
+ **id** | **str**| Choose a detector by its ID. |
### Return type
@@ -167,9 +158,7 @@ void (empty response body)
- **Content-Type**: Not defined
- **Accept**: Not defined
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No response body | - |
@@ -186,13 +175,14 @@ Retrieve a detector by its ID.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detectors_api
-from groundlight_openapi_client.model.detector import Detector
+from groundlight_openapi_client.models.detector import Detector
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -205,7 +195,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -213,23 +203,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detectors_api.DetectorsApi(api_client)
- id = "id_example" # str | Choose a detector by its ID.
+ api_instance = groundlight_openapi_client.DetectorsApi(api_client)
+ id = 'id_example' # str | Choose a detector by its ID.
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_detector(id)
+ print("The response of DetectorsApi->get_detector:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorsApi->get_detector: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **str**| Choose a detector by its ID. |
+ **id** | **str**| Choose a detector by its ID. |
### Return type
@@ -244,9 +235,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -254,7 +243,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_detector_evaluation**
-> InlineResponse2001 get_detector_evaluation(id)
+> GetDetectorEvaluation200Response get_detector_evaluation(id)
@@ -263,13 +252,14 @@ Get Detector evaluation results. The result is null if there isn't enough ground
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detectors_api
-from groundlight_openapi_client.model.inline_response2001 import InlineResponse2001
+from groundlight_openapi_client.models.get_detector_evaluation200_response import GetDetectorEvaluation200Response
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -282,7 +272,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -290,27 +280,28 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detectors_api.DetectorsApi(api_client)
- id = "id_example" # str |
+ api_instance = groundlight_openapi_client.DetectorsApi(api_client)
+ id = 'id_example' # str |
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_detector_evaluation(id)
+ print("The response of DetectorsApi->get_detector_evaluation:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorsApi->get_detector_evaluation: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **str**| |
+ **id** | **str**| |
### Return type
-[**InlineResponse2001**](InlineResponse2001.md)
+[**GetDetectorEvaluation200Response**](GetDetectorEvaluation200Response.md)
### Authorization
@@ -321,9 +312,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -331,7 +320,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_detector_metrics**
-> InlineResponse200 get_detector_metrics(detector_id)
+> GetDetectorMetrics200Response get_detector_metrics(detector_id)
@@ -340,13 +329,14 @@ Get Detector metrics, primarily the counts of different types of labels
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detectors_api
-from groundlight_openapi_client.model.inline_response200 import InlineResponse200
+from groundlight_openapi_client.models.get_detector_metrics200_response import GetDetectorMetrics200Response
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -359,7 +349,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -367,27 +357,28 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detectors_api.DetectorsApi(api_client)
- detector_id = "detector_id_example" # str |
+ api_instance = groundlight_openapi_client.DetectorsApi(api_client)
+ detector_id = 'detector_id_example' # str |
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_detector_metrics(detector_id)
+ print("The response of DetectorsApi->get_detector_metrics:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorsApi->get_detector_metrics: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| |
+ **detector_id** | **str**| |
### Return type
-[**InlineResponse200**](InlineResponse200.md)
+[**GetDetectorMetrics200Response**](GetDetectorMetrics200Response.md)
### Authorization
@@ -398,9 +389,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -408,7 +397,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **list_detectors**
-> PaginatedDetectorList list_detectors()
+> PaginatedDetectorList list_detectors(page=page, page_size=page_size)
@@ -417,13 +406,14 @@ Retrieve a list of detectors.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detectors_api
-from groundlight_openapi_client.model.paginated_detector_list import PaginatedDetectorList
+from groundlight_openapi_client.models.paginated_detector_list import PaginatedDetectorList
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -436,7 +426,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -444,26 +434,26 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detectors_api.DetectorsApi(api_client)
- page = 1 # int | A page number within the paginated result set. (optional)
- page_size = 1 # int | Number of items to return per page. (optional)
+ api_instance = groundlight_openapi_client.DetectorsApi(api_client)
+ page = 56 # int | A page number within the paginated result set. (optional)
+ page_size = 56 # int | Number of items to return per page. (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
api_response = api_instance.list_detectors(page=page, page_size=page_size)
+ print("The response of DetectorsApi->list_detectors:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorsApi->list_detectors: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **page** | **int**| A page number within the paginated result set. | [optional]
- **page_size** | **int**| Number of items to return per page. | [optional]
+ **page** | **int**| A page number within the paginated result set. | [optional]
+ **page_size** | **int**| Number of items to return per page. | [optional]
### Return type
@@ -478,9 +468,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -488,7 +476,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **update_detector**
-> Detector update_detector(id)
+> Detector update_detector(id, patched_detector_request=patched_detector_request)
@@ -497,14 +485,15 @@ Update a detector
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import detectors_api
-from groundlight_openapi_client.model.detector import Detector
-from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest
+from groundlight_openapi_client.models.detector import Detector
+from groundlight_openapi_client.models.patched_detector_request import PatchedDetectorRequest
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -517,7 +506,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -525,39 +514,26 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = detectors_api.DetectorsApi(api_client)
- id = "id_example" # str |
- patched_detector_request = PatchedDetectorRequest(
- name="name_example",
- confidence_threshold=0.9,
- patience_time=30.0,
- status=None,
- escalation_type="escalation_type_example",
- ) # PatchedDetectorRequest | (optional)
-
- # example passing only required values which don't have defaults set
- try:
- api_response = api_instance.update_detector(id)
- pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
- print("Exception when calling DetectorsApi->update_detector: %s\n" % e)
+ api_instance = groundlight_openapi_client.DetectorsApi(api_client)
+ id = 'id_example' # str |
+ patched_detector_request = groundlight_openapi_client.PatchedDetectorRequest() # PatchedDetectorRequest | (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
api_response = api_instance.update_detector(id, patched_detector_request=patched_detector_request)
+ print("The response of DetectorsApi->update_detector:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling DetectorsApi->update_detector: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **str**| |
- **patched_detector_request** | [**PatchedDetectorRequest**](PatchedDetectorRequest.md)| | [optional]
+ **id** | **str**| |
+ **patched_detector_request** | [**PatchedDetectorRequest**](PatchedDetectorRequest.md)| | [optional]
### Return type
@@ -572,9 +548,7 @@ Name | Type | Description | Notes
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
diff --git a/generated/docs/EdgeApi.md b/generated/docs/EdgeApi.md
index 04976261..1355ec5f 100644
--- a/generated/docs/EdgeApi.md
+++ b/generated/docs/EdgeApi.md
@@ -13,17 +13,20 @@ Method | HTTP request | Description
-Edge server periodically calls this to report metrics. POST body will have JSON data that we log.
+Edge server periodically calls this to report metrics.
+
+POST body will have JSON data that we log.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import edge_api
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -36,7 +39,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -44,16 +47,16 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = edge_api.EdgeApi(api_client)
+ api_instance = groundlight_openapi_client.EdgeApi(api_client)
- # example, this endpoint has no required or optional parameters
try:
api_instance.edge_report_metrics_create()
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling EdgeApi->edge_report_metrics_create: %s\n" % e)
```
+
### Parameters
This endpoint does not need any parameter.
@@ -70,9 +73,7 @@ void (empty response body)
- **Content-Type**: Not defined
- **Accept**: Not defined
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | No response body | - |
@@ -89,13 +90,14 @@ Gets time limited pre-authenticated URLs to download a detector's edge model and
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import edge_api
-from groundlight_openapi_client.model.edge_model_info import EdgeModelInfo
+from groundlight_openapi_client.models.edge_model_info import EdgeModelInfo
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -108,7 +110,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -116,23 +118,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = edge_api.EdgeApi(api_client)
- detector_id = "detector_id_example" # str |
+ api_instance = groundlight_openapi_client.EdgeApi(api_client)
+ detector_id = 'detector_id_example' # str |
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_model_urls(detector_id)
+ print("The response of EdgeApi->get_model_urls:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling EdgeApi->get_model_urls: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| |
+ **detector_id** | **str**| |
### Return type
@@ -147,9 +150,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
diff --git a/generated/docs/EdgeModelInfo.md b/generated/docs/EdgeModelInfo.md
index 3141373f..175ebcc4 100644
--- a/generated/docs/EdgeModelInfo.md
+++ b/generated/docs/EdgeModelInfo.md
@@ -9,11 +9,27 @@ Name | Type | Description | Notes
**model_binary_url** | **str** | | [optional]
**oodd_model_binary_id** | **str** | | [optional]
**oodd_model_binary_url** | **str** | | [optional]
-**pipeline_config** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**oodd_pipeline_config** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**predictor_metadata** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**pipeline_config** | **object** | | [optional]
+**oodd_pipeline_config** | **object** | | [optional]
+**predictor_metadata** | **object** | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.edge_model_info import EdgeModelInfo
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of EdgeModelInfo from a JSON string
+edge_model_info_instance = EdgeModelInfo.from_json(json)
+# print the JSON string representation of the object
+print EdgeModelInfo.to_json()
+
+# convert the object into a dict
+edge_model_info_dict = edge_model_info_instance.to_dict()
+# create an instance of EdgeModelInfo from a dict
+edge_model_info_from_dict = EdgeModelInfo.from_dict(edge_model_info_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/EscalationTypeEnum.md b/generated/docs/EscalationTypeEnum.md
index d7842681..3a3ce20a 100644
--- a/generated/docs/EscalationTypeEnum.md
+++ b/generated/docs/EscalationTypeEnum.md
@@ -1,10 +1,11 @@
# EscalationTypeEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["STANDARD", "NO_HUMAN_LABELING", ]
+## Enum
+
+* `STANDARD` (value: `'STANDARD'`)
+
+* `NO_HUMAN_LABELING` (value: `'NO_HUMAN_LABELING'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/GetDetectorEvaluation200Response.md b/generated/docs/GetDetectorEvaluation200Response.md
new file mode 100644
index 00000000..ab6116f9
--- /dev/null
+++ b/generated/docs/GetDetectorEvaluation200Response.md
@@ -0,0 +1,28 @@
+# GetDetectorEvaluation200Response
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**evaluation_results** | [**GetDetectorEvaluation200ResponseEvaluationResults**](GetDetectorEvaluation200ResponseEvaluationResults.md) | | [optional]
+
+## Example
+
+```python
+from groundlight_openapi_client.models.get_detector_evaluation200_response import GetDetectorEvaluation200Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of GetDetectorEvaluation200Response from a JSON string
+get_detector_evaluation200_response_instance = GetDetectorEvaluation200Response.from_json(json)
+# print the JSON string representation of the object
+print GetDetectorEvaluation200Response.to_json()
+
+# convert the object into a dict
+get_detector_evaluation200_response_dict = get_detector_evaluation200_response_instance.to_dict()
+# create an instance of GetDetectorEvaluation200Response from a dict
+get_detector_evaluation200_response_from_dict = GetDetectorEvaluation200Response.from_dict(get_detector_evaluation200_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/GetDetectorEvaluation200ResponseEvaluationResults.md b/generated/docs/GetDetectorEvaluation200ResponseEvaluationResults.md
new file mode 100644
index 00000000..6110abea
--- /dev/null
+++ b/generated/docs/GetDetectorEvaluation200ResponseEvaluationResults.md
@@ -0,0 +1,46 @@
+# GetDetectorEvaluation200ResponseEvaluationResults
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**eval_timestamp** | **datetime** | | [optional]
+**total_ground_truth_examples** | **int** | | [optional]
+**total_labeled_examples** | **int** | | [optional]
+**kfold_pooled__balanced_accuracy** | **float** | | [optional]
+**kfold_pooled__positive_accuracy** | **float** | | [optional]
+**kfold_pooled__negative_accuracy** | **float** | | [optional]
+**precision__mean** | **float** | | [optional]
+**recall__mean** | **float** | | [optional]
+**roc_auc__mean** | **float** | | [optional]
+**balanced_system_accuracies** | **Dict[str, object]** | | [optional]
+**positive_system_accuracies** | **Dict[str, object]** | | [optional]
+**negative_system_accuracies** | **Dict[str, object]** | | [optional]
+**mean_absolute_error__mean** | **float** | | [optional]
+**objdet_precision__mean** | **float** | | [optional]
+**objdet_recall__mean** | **float** | | [optional]
+**objdet_f1_score__mean** | **float** | | [optional]
+**class_accuracies** | **Dict[str, object]** | | [optional]
+**confusion_dict** | **Dict[str, object]** | | [optional]
+**num_examples_per_class** | **Dict[str, object]** | | [optional]
+
+## Example
+
+```python
+from groundlight_openapi_client.models.get_detector_evaluation200_response_evaluation_results import GetDetectorEvaluation200ResponseEvaluationResults
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of GetDetectorEvaluation200ResponseEvaluationResults from a JSON string
+get_detector_evaluation200_response_evaluation_results_instance = GetDetectorEvaluation200ResponseEvaluationResults.from_json(json)
+# print the JSON string representation of the object
+print GetDetectorEvaluation200ResponseEvaluationResults.to_json()
+
+# convert the object into a dict
+get_detector_evaluation200_response_evaluation_results_dict = get_detector_evaluation200_response_evaluation_results_instance.to_dict()
+# create an instance of GetDetectorEvaluation200ResponseEvaluationResults from a dict
+get_detector_evaluation200_response_evaluation_results_from_dict = GetDetectorEvaluation200ResponseEvaluationResults.from_dict(get_detector_evaluation200_response_evaluation_results_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/GetDetectorMetrics200Response.md b/generated/docs/GetDetectorMetrics200Response.md
new file mode 100644
index 00000000..60ae020b
--- /dev/null
+++ b/generated/docs/GetDetectorMetrics200Response.md
@@ -0,0 +1,28 @@
+# GetDetectorMetrics200Response
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**summary** | [**GetDetectorMetrics200ResponseSummary**](GetDetectorMetrics200ResponseSummary.md) | | [optional]
+
+## Example
+
+```python
+from groundlight_openapi_client.models.get_detector_metrics200_response import GetDetectorMetrics200Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of GetDetectorMetrics200Response from a JSON string
+get_detector_metrics200_response_instance = GetDetectorMetrics200Response.from_json(json)
+# print the JSON string representation of the object
+print GetDetectorMetrics200Response.to_json()
+
+# convert the object into a dict
+get_detector_metrics200_response_dict = get_detector_metrics200_response_instance.to_dict()
+# create an instance of GetDetectorMetrics200Response from a dict
+get_detector_metrics200_response_from_dict = GetDetectorMetrics200Response.from_dict(get_detector_metrics200_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/GetDetectorMetrics200ResponseSummary.md b/generated/docs/GetDetectorMetrics200ResponseSummary.md
new file mode 100644
index 00000000..21018836
--- /dev/null
+++ b/generated/docs/GetDetectorMetrics200ResponseSummary.md
@@ -0,0 +1,32 @@
+# GetDetectorMetrics200ResponseSummary
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**num_ground_truth** | **int** | | [optional]
+**num_current_source_human** | **int** | | [optional]
+**class_counts** | [**GetDetectorMetrics200ResponseSummaryClassCounts**](GetDetectorMetrics200ResponseSummaryClassCounts.md) | | [optional]
+**unconfident_counts** | **object** | | [optional]
+**total_iqs** | **int** | | [optional]
+
+## Example
+
+```python
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary import GetDetectorMetrics200ResponseSummary
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of GetDetectorMetrics200ResponseSummary from a JSON string
+get_detector_metrics200_response_summary_instance = GetDetectorMetrics200ResponseSummary.from_json(json)
+# print the JSON string representation of the object
+print GetDetectorMetrics200ResponseSummary.to_json()
+
+# convert the object into a dict
+get_detector_metrics200_response_summary_dict = get_detector_metrics200_response_summary_instance.to_dict()
+# create an instance of GetDetectorMetrics200ResponseSummary from a dict
+get_detector_metrics200_response_summary_from_dict = GetDetectorMetrics200ResponseSummary.from_dict(get_detector_metrics200_response_summary_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/GetDetectorMetrics200ResponseSummaryClassCounts.md b/generated/docs/GetDetectorMetrics200ResponseSummaryClassCounts.md
new file mode 100644
index 00000000..5b5c9a30
--- /dev/null
+++ b/generated/docs/GetDetectorMetrics200ResponseSummaryClassCounts.md
@@ -0,0 +1,32 @@
+# GetDetectorMetrics200ResponseSummaryClassCounts
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**source_ml** | **object** | | [optional]
+**source_human** | **object** | | [optional]
+**cloud_labeler** | **object** | | [optional]
+**cloud** | **object** | | [optional]
+**total** | **object** | | [optional]
+
+## Example
+
+```python
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary_class_counts import GetDetectorMetrics200ResponseSummaryClassCounts
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of GetDetectorMetrics200ResponseSummaryClassCounts from a JSON string
+get_detector_metrics200_response_summary_class_counts_instance = GetDetectorMetrics200ResponseSummaryClassCounts.from_json(json)
+# print the JSON string representation of the object
+print GetDetectorMetrics200ResponseSummaryClassCounts.to_json()
+
+# convert the object into a dict
+get_detector_metrics200_response_summary_class_counts_dict = get_detector_metrics200_response_summary_class_counts_instance.to_dict()
+# create an instance of GetDetectorMetrics200ResponseSummaryClassCounts from a dict
+get_detector_metrics200_response_summary_class_counts_from_dict = GetDetectorMetrics200ResponseSummaryClassCounts.from_dict(get_detector_metrics200_response_summary_class_counts_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/ImageQueriesApi.md b/generated/docs/ImageQueriesApi.md
index e3f91416..81f093e5 100644
--- a/generated/docs/ImageQueriesApi.md
+++ b/generated/docs/ImageQueriesApi.md
@@ -11,7 +11,7 @@ Method | HTTP request | Description
# **get_image**
-> file_type get_image(id)
+> bytearray get_image(id)
@@ -20,12 +20,13 @@ Retrieve an image by its ID.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import image_queries_api
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -38,7 +39,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -46,27 +47,28 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = image_queries_api.ImageQueriesApi(api_client)
- id = "id_example" # str | Retrieve the image associated with the image query ID.
+ api_instance = groundlight_openapi_client.ImageQueriesApi(api_client)
+ id = 'id_example' # str | Retrieve the image associated with the image query ID.
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_image(id)
+ print("The response of ImageQueriesApi->get_image:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ImageQueriesApi->get_image: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **str**| Retrieve the image associated with the image query ID. |
+ **id** | **str**| Retrieve the image associated with the image query ID. |
### Return type
-**file_type**
+**bytearray**
### Authorization
@@ -77,9 +79,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: image/jpeg
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -96,13 +96,14 @@ Retrieve an image-query by its ID.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import image_queries_api
-from groundlight_openapi_client.model.image_query import ImageQuery
+from groundlight_openapi_client.models.image_query import ImageQuery
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -115,7 +116,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -123,23 +124,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = image_queries_api.ImageQueriesApi(api_client)
- id = "id_example" # str | Choose an image query by its ID.
+ api_instance = groundlight_openapi_client.ImageQueriesApi(api_client)
+ id = 'id_example' # str | Choose an image query by its ID.
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_image_query(id)
+ print("The response of ImageQueriesApi->get_image_query:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ImageQueriesApi->get_image_query: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **id** | **str**| Choose an image query by its ID. |
+ **id** | **str**| Choose an image query by its ID. |
### Return type
@@ -154,9 +156,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -164,7 +164,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **list_image_queries**
-> PaginatedImageQueryList list_image_queries()
+> PaginatedImageQueryList list_image_queries(detector_id=detector_id, page=page, page_size=page_size)
@@ -173,13 +173,14 @@ Retrieve a list of image-queries.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import image_queries_api
-from groundlight_openapi_client.model.paginated_image_query_list import PaginatedImageQueryList
+from groundlight_openapi_client.models.paginated_image_query_list import PaginatedImageQueryList
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -192,7 +193,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -200,28 +201,28 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = image_queries_api.ImageQueriesApi(api_client)
- detector_id = "detector_id_example" # str | Optionally filter image queries by detector ID. (optional)
- page = 1 # int | A page number within the paginated result set. (optional)
- page_size = 1 # int | Number of items to return per page. (optional)
+ api_instance = groundlight_openapi_client.ImageQueriesApi(api_client)
+ detector_id = 'detector_id_example' # str | Optionally filter image queries by detector ID. (optional)
+ page = 56 # int | A page number within the paginated result set. (optional)
+ page_size = 56 # int | Number of items to return per page. (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
api_response = api_instance.list_image_queries(detector_id=detector_id, page=page, page_size=page_size)
+ print("The response of ImageQueriesApi->list_image_queries:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ImageQueriesApi->list_image_queries: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| Optionally filter image queries by detector ID. | [optional]
- **page** | **int**| A page number within the paginated result set. | [optional]
- **page_size** | **int**| Number of items to return per page. | [optional]
+ **detector_id** | **str**| Optionally filter image queries by detector ID. | [optional]
+ **page** | **int**| A page number within the paginated result set. | [optional]
+ **page_size** | **int**| Number of items to return per page. | [optional]
### Return type
@@ -236,9 +237,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
@@ -246,22 +245,32 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **submit_image_query**
-> ImageQuery submit_image_query(detector_id)
+> ImageQuery submit_image_query(detector_id, confidence_threshold=confidence_threshold, human_review=human_review, image_query_id=image_query_id, inspection_id=inspection_id, metadata=metadata, patience_time=patience_time, want_async=want_async, body=body)
+
- Submit an image query against a detector. You must use `\"Content-Type: image/jpeg\"` or similar (image/png, image/webp, etc) for the image data. For example: ```Bash $ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \\ --header \"Content-Type: image/jpeg\" \\ --data-binary @path/to/filename.jpeg ```
+Submit an image query against a detector.
+
+You must use `"Content-Type: image/jpeg"` or similar (image/png, image/webp, etc) for the image data. For example:
+```Bash
+$ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \
+ --header "Content-Type: image/jpeg" \
+ --data-binary @path/to/filename.jpeg
+```
+
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import image_queries_api
-from groundlight_openapi_client.model.image_query import ImageQuery
+from groundlight_openapi_client.models.image_query import ImageQuery
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -274,7 +283,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -282,47 +291,40 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = image_queries_api.ImageQueriesApi(api_client)
- detector_id = "detector_id_example" # str | Choose a detector by its ID.
- confidence_threshold = 0 # float | The confidence threshold for the image query. (optional)
- human_review = "human_review_example" # str | If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. (optional)
- image_query_id = "image_query_id_example" # str | The ID to assign to the created image query. (optional)
- inspection_id = "inspection_id_example" # str | Associate the image query with an inspection. (optional)
- metadata = "metadata_example" # str | A dictionary of custom key/value metadata to associate with the image query (limited to 1KB). (optional)
- patience_time = 3.14 # float | How long to wait for a confident response. (optional)
- want_async = "want_async_example" # str | If \"true\" then submitting an image query returns immediately without a result. The result will be computed asynchronously and can be retrieved later. (optional)
- body = open('/path/to/file', 'rb') # file_type | (optional)
-
- # example passing only required values which don't have defaults set
- try:
- api_response = api_instance.submit_image_query(detector_id)
- pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
- print("Exception when calling ImageQueriesApi->submit_image_query: %s\n" % e)
+ api_instance = groundlight_openapi_client.ImageQueriesApi(api_client)
+ detector_id = 'detector_id_example' # str | Choose a detector by its ID.
+ confidence_threshold = 3.4 # float | The confidence threshold for the image query. (optional)
+ human_review = 'human_review_example' # str | If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. (optional)
+ image_query_id = 'image_query_id_example' # str | The ID to assign to the created image query. (optional)
+ inspection_id = 'inspection_id_example' # str | Associate the image query with an inspection. (optional)
+ metadata = 'metadata_example' # str | A dictionary of custom key/value metadata to associate with the image query (limited to 1KB). (optional)
+ patience_time = 3.4 # float | How long to wait for a confident response. (optional)
+ want_async = 'want_async_example' # str | If \"true\" then submitting an image query returns immediately without a result. The result will be computed asynchronously and can be retrieved later. (optional)
+ body = None # bytearray | (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
api_response = api_instance.submit_image_query(detector_id, confidence_threshold=confidence_threshold, human_review=human_review, image_query_id=image_query_id, inspection_id=inspection_id, metadata=metadata, patience_time=patience_time, want_async=want_async, body=body)
+ print("The response of ImageQueriesApi->submit_image_query:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling ImageQueriesApi->submit_image_query: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| Choose a detector by its ID. |
- **confidence_threshold** | **float**| The confidence threshold for the image query. | [optional]
- **human_review** | **str**| If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. | [optional]
- **image_query_id** | **str**| The ID to assign to the created image query. | [optional]
- **inspection_id** | **str**| Associate the image query with an inspection. | [optional]
- **metadata** | **str**| A dictionary of custom key/value metadata to associate with the image query (limited to 1KB). | [optional]
- **patience_time** | **float**| How long to wait for a confident response. | [optional]
- **want_async** | **str**| If \"true\" then submitting an image query returns immediately without a result. The result will be computed asynchronously and can be retrieved later. | [optional]
- **body** | **file_type**| | [optional]
+ **detector_id** | **str**| Choose a detector by its ID. |
+ **confidence_threshold** | **float**| The confidence threshold for the image query. | [optional]
+ **human_review** | **str**| If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident. | [optional]
+ **image_query_id** | **str**| The ID to assign to the created image query. | [optional]
+ **inspection_id** | **str**| Associate the image query with an inspection. | [optional]
+ **metadata** | **str**| A dictionary of custom key/value metadata to associate with the image query (limited to 1KB). | [optional]
+ **patience_time** | **float**| How long to wait for a confident response. | [optional]
+ **want_async** | **str**| If \"true\" then submitting an image query returns immediately without a result. The result will be computed asynchronously and can be retrieved later. | [optional]
+ **body** | **bytearray**| | [optional]
### Return type
@@ -337,9 +339,7 @@ Name | Type | Description | Notes
- **Content-Type**: image/jpeg, image/jpg, image/png, image/gif, image/webp, image/bmp, image/x-icon
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | | - |
diff --git a/generated/docs/ImageQuery.md b/generated/docs/ImageQuery.md
index 6ed5ae92..d94bb8bd 100644
--- a/generated/docs/ImageQuery.md
+++ b/generated/docs/ImageQuery.md
@@ -5,21 +5,37 @@ ImageQuery objects are the answers to natural language questions about images cr
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**metadata** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | Metadata about the image query. | [readonly]
+**metadata** | **Dict[str, object]** | Metadata about the image query. | [readonly]
**id** | **str** | A unique ID for this object. | [readonly]
-**type** | **bool, date, datetime, dict, float, int, list, str, none_type** | The type of this object. | [readonly]
+**type** | [**ImageQueryTypeEnum**](ImageQueryTypeEnum.md) | The type of this object. | [readonly]
**created_at** | **datetime** | When was this detector created? | [readonly]
**query** | **str** | A question about the image. | [readonly]
**detector_id** | **str** | Which detector was used on this image query? | [readonly]
-**result_type** | **bool, date, datetime, dict, float, int, list, str, none_type** | What type of result are we returning? | [readonly]
-**result** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
+**result_type** | [**ResultTypeEnum**](ResultTypeEnum.md) | What type of result are we returning? | [readonly]
+**result** | [**ImageQueryResult**](ImageQueryResult.md) | |
**patience_time** | **float** | How long to wait for a confident response. | [readonly]
**confidence_threshold** | **float** | Min confidence needed to accept the response of the image query. | [readonly]
-**rois** | [**[ROI], none_type**](ROI.md) | An array of regions of interest (bounding boxes) collected on image | [readonly]
-**text** | **str, none_type** | A text field on image query. | [readonly]
-**done_processing** | **bool** | EDGE ONLY - Whether the image query has completed escalating and will receive no new results. | [optional] if omitted the server will use the default value of False
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**rois** | [**List[ROI]**](ROI.md) | An array of regions of interest (bounding boxes) collected on image | [readonly]
+**text** | **str** | A text field on image query. | [readonly]
+**done_processing** | **bool** | EDGE ONLY - Whether the image query has completed escalating and will receive no new results. | [optional] [default to False]
+## Example
+
+```python
+from groundlight_openapi_client.models.image_query import ImageQuery
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ImageQuery from a JSON string
+image_query_instance = ImageQuery.from_json(json)
+# print the JSON string representation of the object
+print ImageQuery.to_json()
+
+# convert the object into a dict
+image_query_dict = image_query_instance.to_dict()
+# create an instance of ImageQuery from a dict
+image_query_from_dict = ImageQuery.from_dict(image_query_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/ImageQueryResult.md b/generated/docs/ImageQueryResult.md
new file mode 100644
index 00000000..fb86cc58
--- /dev/null
+++ b/generated/docs/ImageQueryResult.md
@@ -0,0 +1,36 @@
+# ImageQueryResult
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**confidence** | **float** | | [optional]
+**source** | **str** | | [optional]
+**result_type** | **str** | | [optional]
+**from_edge** | **bool** | | [optional]
+**label** | **str** | |
+**count** | **int** | |
+**greater_than_max** | **bool** | | [optional]
+**text** | **str** | |
+**truncated** | **bool** | |
+
+## Example
+
+```python
+from groundlight_openapi_client.models.image_query_result import ImageQueryResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ImageQueryResult from a JSON string
+image_query_result_instance = ImageQueryResult.from_json(json)
+# print the JSON string representation of the object
+print ImageQueryResult.to_json()
+
+# convert the object into a dict
+image_query_result_dict = image_query_result_instance.to_dict()
+# create an instance of ImageQueryResult from a dict
+image_query_result_from_dict = ImageQueryResult.from_dict(image_query_result_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/ImageQueryTypeEnum.md b/generated/docs/ImageQueryTypeEnum.md
index 27a72eef..298ad42a 100644
--- a/generated/docs/ImageQueryTypeEnum.md
+++ b/generated/docs/ImageQueryTypeEnum.md
@@ -1,10 +1,9 @@
# ImageQueryTypeEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | defaults to "image_query", must be one of ["image_query", ]
+## Enum
+
+* `IMAGE_QUERY` (value: `'image_query'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/InlineResponse200.md b/generated/docs/InlineResponse200.md
index 23dc2df0..2ec59dfb 100644
--- a/generated/docs/InlineResponse200.md
+++ b/generated/docs/InlineResponse200.md
@@ -1,7 +1,6 @@
# InlineResponse200
-
-## Properties
+#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**summary** | [**InlineResponse200Summary**](InlineResponse200Summary.md) | | [optional]
@@ -9,4 +8,3 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/generated/docs/InlineResponse2001.md b/generated/docs/InlineResponse2001.md
index aa7bbe38..31f0d33a 100644
--- a/generated/docs/InlineResponse2001.md
+++ b/generated/docs/InlineResponse2001.md
@@ -1,7 +1,6 @@
# InlineResponse2001
-
-## Properties
+#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**evaluation_results** | [**InlineResponse2001EvaluationResults**](InlineResponse2001EvaluationResults.md) | | [optional]
@@ -9,4 +8,3 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/generated/docs/InlineResponse2001EvaluationResults.md b/generated/docs/InlineResponse2001EvaluationResults.md
index b73d0ff3..74fd9788 100644
--- a/generated/docs/InlineResponse2001EvaluationResults.md
+++ b/generated/docs/InlineResponse2001EvaluationResults.md
@@ -1,25 +1,24 @@
# InlineResponse2001EvaluationResults
-
-## Properties
+#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**eval_timestamp** | **datetime** | | [optional]
**total_ground_truth_examples** | **int, none_type** | | [optional]
**total_labeled_examples** | **int, none_type** | | [optional]
-**kfold_pooled__balanced_accuracy** | **float** | | [optional]
-**kfold_pooled__positive_accuracy** | **float, none_type** | | [optional]
-**kfold_pooled__negative_accuracy** | **float, none_type** | | [optional]
-**precision__mean** | **float, none_type** | | [optional]
-**recall__mean** | **float, none_type** | | [optional]
-**roc_auc__mean** | **float, none_type** | | [optional]
+**kfold_pooled__balanced_accuracy** | **int, float** | | [optional]
+**kfold_pooled__positive_accuracy** | **int, float, none_type** | | [optional]
+**kfold_pooled__negative_accuracy** | **int, float, none_type** | | [optional]
+**precision__mean** | **int, float, none_type** | | [optional]
+**recall__mean** | **int, float, none_type** | | [optional]
+**roc_auc__mean** | **int, float, none_type** | | [optional]
**balanced_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
**positive_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
**negative_system_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
-**mean_absolute_error__mean** | **float, none_type** | | [optional]
-**objdet_precision__mean** | **float, none_type** | | [optional]
-**objdet_recall__mean** | **float, none_type** | | [optional]
-**objdet_f1_score__mean** | **float, none_type** | | [optional]
+**mean_absolute_error__mean** | **int, float, none_type** | | [optional]
+**objdet_precision__mean** | **int, float, none_type** | | [optional]
+**objdet_recall__mean** | **int, float, none_type** | | [optional]
+**objdet_f1_score__mean** | **int, float, none_type** | | [optional]
**class_accuracies** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
**confusion_dict** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
**num_examples_per_class** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type** | | [optional]
@@ -27,4 +26,3 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/generated/docs/InlineResponse2002.md b/generated/docs/InlineResponse2002.md
index 59b1a320..b30dd043 100644
--- a/generated/docs/InlineResponse2002.md
+++ b/generated/docs/InlineResponse2002.md
@@ -1,12 +1,10 @@
# InlineResponse2002
-
-## Properties
+#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**username** | **str** | The user's username | [optional]
+**username** | **str** | The user's username | [optional]
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/generated/docs/InlineResponse200Summary.md b/generated/docs/InlineResponse200Summary.md
index aebcac9c..7c2b559c 100644
--- a/generated/docs/InlineResponse200Summary.md
+++ b/generated/docs/InlineResponse200Summary.md
@@ -1,7 +1,6 @@
# InlineResponse200Summary
-
-## Properties
+#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**num_ground_truth** | **int** | | [optional]
@@ -13,4 +12,3 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/generated/docs/InlineResponse200SummaryClassCounts.md b/generated/docs/InlineResponse200SummaryClassCounts.md
index 463959ad..e40c6c91 100644
--- a/generated/docs/InlineResponse200SummaryClassCounts.md
+++ b/generated/docs/InlineResponse200SummaryClassCounts.md
@@ -1,7 +1,6 @@
# InlineResponse200SummaryClassCounts
-
-## Properties
+#### Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**source_ml** | **{str: (bool, date, datetime, dict, float, int, list, str, none_type)}** | | [optional]
@@ -13,4 +12,3 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
-
diff --git a/generated/docs/Label.md b/generated/docs/Label.md
index 8e75ee67..c541a004 100644
--- a/generated/docs/Label.md
+++ b/generated/docs/Label.md
@@ -1,10 +1,13 @@
# Label
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["YES", "NO", "UNCLEAR", ]
+## Enum
+
+* `YES` (value: `'YES'`)
+
+* `NO` (value: `'NO'`)
+
+* `UNCLEAR` (value: `'UNCLEAR'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/LabelValue.md b/generated/docs/LabelValue.md
index da087687..6c50835f 100644
--- a/generated/docs/LabelValue.md
+++ b/generated/docs/LabelValue.md
@@ -4,16 +4,32 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**confidence** | **float, none_type** | | [readonly]
-**class_name** | **str, none_type** | Return a human-readable class name for this label (e.g. YES/NO) | [readonly]
-**annotations_requested** | **[str]** | | [readonly]
+**confidence** | **float** | | [readonly]
+**class_name** | **str** | Return a human-readable class name for this label (e.g. YES/NO) | [readonly]
+**rois** | [**List[ROI]**](ROI.md) | | [optional]
+**annotations_requested** | **List[str]** | | [readonly]
**created_at** | **datetime** | | [readonly]
-**detector_id** | **int, none_type** | | [readonly]
+**detector_id** | **int** | | [readonly]
**source** | **str** | | [readonly]
-**text** | **str, none_type** | Text annotations | [readonly]
-**rois** | [**[ROI], none_type**](ROI.md) | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**text** | **str** | Text annotations | [readonly]
+## Example
+
+```python
+from groundlight_openapi_client.models.label_value import LabelValue
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LabelValue from a JSON string
+label_value_instance = LabelValue.from_json(json)
+# print the JSON string representation of the object
+print LabelValue.to_json()
+
+# convert the object into a dict
+label_value_dict = label_value_instance.to_dict()
+# create an instance of LabelValue from a dict
+label_value_from_dict = LabelValue.from_dict(label_value_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/LabelValueRequest.md b/generated/docs/LabelValueRequest.md
index baa15c2f..8f8e672b 100644
--- a/generated/docs/LabelValueRequest.md
+++ b/generated/docs/LabelValueRequest.md
@@ -4,11 +4,27 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**label** | **str, none_type** | |
+**label** | **str** | |
**image_query_id** | **str** | |
-**rois** | [**[ROIRequest], none_type**](ROIRequest.md) | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**rois** | [**List[ROIRequest]**](ROIRequest.md) | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.label_value_request import LabelValueRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of LabelValueRequest from a JSON string
+label_value_request_instance = LabelValueRequest.from_json(json)
+# print the JSON string representation of the object
+print LabelValueRequest.to_json()
+
+# convert the object into a dict
+label_value_request_dict = label_value_request_instance.to_dict()
+# create an instance of LabelValueRequest from a dict
+label_value_request_from_dict = LabelValueRequest.from_dict(label_value_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/LabelsApi.md b/generated/docs/LabelsApi.md
index 487e3fe4..20c729b8 100644
--- a/generated/docs/LabelsApi.md
+++ b/generated/docs/LabelsApi.md
@@ -12,19 +12,21 @@ Method | HTTP request | Description
-Create a new LabelValue and attach it to an image query. This will trigger asynchronous fine-tuner model training.
+Create a new LabelValue and attach it to an image query. This will trigger
+asynchronous fine-tuner model training.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import labels_api
-from groundlight_openapi_client.model.label_value import LabelValue
-from groundlight_openapi_client.model.label_value_request import LabelValueRequest
+from groundlight_openapi_client.models.label_value import LabelValue
+from groundlight_openapi_client.models.label_value_request import LabelValueRequest
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -37,7 +39,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -45,37 +47,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = labels_api.LabelsApi(api_client)
- label_value_request = LabelValueRequest(
- label="label_example",
- image_query_id="image_query_id_example",
- rois=[
- ROIRequest(
- label="label_example",
- geometry=BBoxGeometryRequest(
- left=3.14,
- top=3.14,
- right=3.14,
- bottom=3.14,
- ),
- ),
- ],
- ) # LabelValueRequest |
-
- # example passing only required values which don't have defaults set
+ api_instance = groundlight_openapi_client.LabelsApi(api_client)
+ label_value_request = groundlight_openapi_client.LabelValueRequest() # LabelValueRequest |
+
try:
api_response = api_instance.create_label(label_value_request)
+ print("The response of LabelsApi->create_label:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling LabelsApi->create_label: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **label_value_request** | [**LabelValueRequest**](LabelValueRequest.md)| |
+ **label_value_request** | [**LabelValueRequest**](LabelValueRequest.md)| |
### Return type
@@ -90,9 +79,7 @@ Name | Type | Description | Notes
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | | - |
diff --git a/generated/docs/ModeEnum.md b/generated/docs/ModeEnum.md
index 720ccf3e..774c5a0c 100644
--- a/generated/docs/ModeEnum.md
+++ b/generated/docs/ModeEnum.md
@@ -1,10 +1,17 @@
# ModeEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ]
+## Enum
+
+* `BINARY` (value: `'BINARY'`)
+
+* `COUNT` (value: `'COUNT'`)
+
+* `MULTI_CLASS` (value: `'MULTI_CLASS'`)
+
+* `TEXT` (value: `'TEXT'`)
+
+* `BOUNDING_BOX` (value: `'BOUNDING_BOX'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/MultiClassModeConfiguration.md b/generated/docs/MultiClassModeConfiguration.md
index 32570bcf..d9f612d3 100644
--- a/generated/docs/MultiClassModeConfiguration.md
+++ b/generated/docs/MultiClassModeConfiguration.md
@@ -4,10 +4,26 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**class_names** | **[str]** | |
+**class_names** | **List[str]** | |
**num_classes** | **int** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.multi_class_mode_configuration import MultiClassModeConfiguration
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MultiClassModeConfiguration from a JSON string
+multi_class_mode_configuration_instance = MultiClassModeConfiguration.from_json(json)
+# print the JSON string representation of the object
+print MultiClassModeConfiguration.to_json()
+
+# convert the object into a dict
+multi_class_mode_configuration_dict = multi_class_mode_configuration_instance.to_dict()
+# create an instance of MultiClassModeConfiguration from a dict
+multi_class_mode_configuration_from_dict = MultiClassModeConfiguration.from_dict(multi_class_mode_configuration_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/MultiClassificationResult.md b/generated/docs/MultiClassificationResult.md
index d048a5da..a8a74249 100644
--- a/generated/docs/MultiClassificationResult.md
+++ b/generated/docs/MultiClassificationResult.md
@@ -4,13 +4,29 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**label** | **str** | |
-**confidence** | **float, none_type** | | [optional]
+**confidence** | **float** | | [optional]
**source** | **str** | | [optional]
-**result_type** | **str** | | [optional] if omitted the server will use the default value of "multi_classification"
+**result_type** | **str** | | [optional]
**from_edge** | **bool** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**label** | **str** | |
+
+## Example
+
+```python
+from groundlight_openapi_client.models.multi_classification_result import MultiClassificationResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of MultiClassificationResult from a JSON string
+multi_classification_result_instance = MultiClassificationResult.from_json(json)
+# print the JSON string representation of the object
+print MultiClassificationResult.to_json()
+# convert the object into a dict
+multi_classification_result_dict = multi_classification_result_instance.to_dict()
+# create an instance of MultiClassificationResult from a dict
+multi_classification_result_from_dict = MultiClassificationResult.from_dict(multi_classification_result_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/Note.md b/generated/docs/Note.md
index a5e80378..a86a1eb1 100644
--- a/generated/docs/Note.md
+++ b/generated/docs/Note.md
@@ -5,10 +5,26 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**detector_id** | **str** | | [readonly]
-**content** | **str, none_type** | Text content of the note. | [optional]
-**is_pinned** | **bool, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**content** | **str** | Text content of the note. | [optional]
+**is_pinned** | **bool** | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.note import Note
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Note from a JSON string
+note_instance = Note.from_json(json)
+# print the JSON string representation of the object
+print Note.to_json()
+
+# convert the object into a dict
+note_dict = note_instance.to_dict()
+# create an instance of Note from a dict
+note_from_dict = Note.from_dict(note_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/NoteRequest.md b/generated/docs/NoteRequest.md
index 783cb431..3946ba5d 100644
--- a/generated/docs/NoteRequest.md
+++ b/generated/docs/NoteRequest.md
@@ -4,11 +4,27 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**content** | **str, none_type** | Text content of the note. | [optional]
-**is_pinned** | **bool, none_type** | | [optional]
-**image** | **file_type, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**content** | **str** | Text content of the note. | [optional]
+**is_pinned** | **bool** | | [optional]
+**image** | **bytearray** | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.note_request import NoteRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of NoteRequest from a JSON string
+note_request_instance = NoteRequest.from_json(json)
+# print the JSON string representation of the object
+print NoteRequest.to_json()
+
+# convert the object into a dict
+note_request_dict = note_request_instance.to_dict()
+# create an instance of NoteRequest from a dict
+note_request_from_dict = NoteRequest.from_dict(note_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/NotesApi.md b/generated/docs/NotesApi.md
index f4e20739..5285919d 100644
--- a/generated/docs/NotesApi.md
+++ b/generated/docs/NotesApi.md
@@ -9,7 +9,7 @@ Method | HTTP request | Description
# **create_note**
-> create_note(detector_id)
+> create_note(detector_id, note_request=note_request)
@@ -18,13 +18,14 @@ Creates a new note.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import notes_api
-from groundlight_openapi_client.model.note_request import NoteRequest
+from groundlight_openapi_client.models.note_request import NoteRequest
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -37,7 +38,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -45,35 +46,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = notes_api.NotesApi(api_client)
- detector_id = "detector_id_example" # str | the detector to associate the new note with
- note_request = NoteRequest(
- content="content_example",
- is_pinned=True,
- image=open('/path/to/file', 'rb'),
- ) # NoteRequest | (optional)
-
- # example passing only required values which don't have defaults set
- try:
- api_instance.create_note(detector_id)
- except groundlight_openapi_client.ApiException as e:
- print("Exception when calling NotesApi->create_note: %s\n" % e)
+ api_instance = groundlight_openapi_client.NotesApi(api_client)
+ detector_id = 'detector_id_example' # str | the detector to associate the new note with
+ note_request = groundlight_openapi_client.NoteRequest() # NoteRequest | (optional)
- # example passing only required values which don't have defaults set
- # and optional values
try:
api_instance.create_note(detector_id, note_request=note_request)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling NotesApi->create_note: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| the detector to associate the new note with |
- **note_request** | [**NoteRequest**](NoteRequest.md)| | [optional]
+ **detector_id** | **str**| the detector to associate the new note with |
+ **note_request** | [**NoteRequest**](NoteRequest.md)| | [optional]
### Return type
@@ -88,9 +78,7 @@ void (empty response body)
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
- **Accept**: Not defined
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No response body | - |
@@ -107,13 +95,14 @@ Retrieves all notes from a given detector and returns them in lists, one for eac
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import notes_api
-from groundlight_openapi_client.model.all_notes import AllNotes
+from groundlight_openapi_client.models.all_notes import AllNotes
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -126,7 +115,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -134,23 +123,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = notes_api.NotesApi(api_client)
- detector_id = "detector_id_example" # str | the detector whose notes to retrieve
+ api_instance = groundlight_openapi_client.NotesApi(api_client)
+ detector_id = 'detector_id_example' # str | the detector whose notes to retrieve
- # example passing only required values which don't have defaults set
try:
api_response = api_instance.get_notes(detector_id)
+ print("The response of NotesApi->get_notes:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling NotesApi->get_notes: %s\n" % e)
```
+
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
- **detector_id** | **str**| the detector whose notes to retrieve |
+ **detector_id** | **str**| the detector whose notes to retrieve |
### Return type
@@ -165,9 +155,7 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
diff --git a/generated/docs/PaginatedDetectorList.md b/generated/docs/PaginatedDetectorList.md
index 52c596a2..1f8b9918 100644
--- a/generated/docs/PaginatedDetectorList.md
+++ b/generated/docs/PaginatedDetectorList.md
@@ -5,11 +5,27 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**count** | **int** | |
-**results** | [**[Detector]**](Detector.md) | |
-**next** | **str, none_type** | | [optional]
-**previous** | **str, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**next** | **str** | | [optional]
+**previous** | **str** | | [optional]
+**results** | [**List[Detector]**](Detector.md) | |
+## Example
+
+```python
+from groundlight_openapi_client.models.paginated_detector_list import PaginatedDetectorList
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PaginatedDetectorList from a JSON string
+paginated_detector_list_instance = PaginatedDetectorList.from_json(json)
+# print the JSON string representation of the object
+print PaginatedDetectorList.to_json()
+
+# convert the object into a dict
+paginated_detector_list_dict = paginated_detector_list_instance.to_dict()
+# create an instance of PaginatedDetectorList from a dict
+paginated_detector_list_from_dict = PaginatedDetectorList.from_dict(paginated_detector_list_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/PaginatedImageQueryList.md b/generated/docs/PaginatedImageQueryList.md
index f5711b9d..7ce7bd60 100644
--- a/generated/docs/PaginatedImageQueryList.md
+++ b/generated/docs/PaginatedImageQueryList.md
@@ -5,11 +5,27 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**count** | **int** | |
-**results** | [**[ImageQuery]**](ImageQuery.md) | |
-**next** | **str, none_type** | | [optional]
-**previous** | **str, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**next** | **str** | | [optional]
+**previous** | **str** | | [optional]
+**results** | [**List[ImageQuery]**](ImageQuery.md) | |
+## Example
+
+```python
+from groundlight_openapi_client.models.paginated_image_query_list import PaginatedImageQueryList
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PaginatedImageQueryList from a JSON string
+paginated_image_query_list_instance = PaginatedImageQueryList.from_json(json)
+# print the JSON string representation of the object
+print PaginatedImageQueryList.to_json()
+
+# convert the object into a dict
+paginated_image_query_list_dict = paginated_image_query_list_instance.to_dict()
+# create an instance of PaginatedImageQueryList from a dict
+paginated_image_query_list_from_dict = PaginatedImageQueryList.from_dict(paginated_image_query_list_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/PaginatedRuleList.md b/generated/docs/PaginatedRuleList.md
index e0d1942b..cbe47f2f 100644
--- a/generated/docs/PaginatedRuleList.md
+++ b/generated/docs/PaginatedRuleList.md
@@ -5,11 +5,27 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**count** | **int** | |
-**results** | [**[Rule]**](Rule.md) | |
-**next** | **str, none_type** | | [optional]
-**previous** | **str, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**next** | **str** | | [optional]
+**previous** | **str** | | [optional]
+**results** | [**List[Rule]**](Rule.md) | |
+## Example
+
+```python
+from groundlight_openapi_client.models.paginated_rule_list import PaginatedRuleList
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PaginatedRuleList from a JSON string
+paginated_rule_list_instance = PaginatedRuleList.from_json(json)
+# print the JSON string representation of the object
+print PaginatedRuleList.to_json()
+
+# convert the object into a dict
+paginated_rule_list_dict = paginated_rule_list_instance.to_dict()
+# create an instance of PaginatedRuleList from a dict
+paginated_rule_list_from_dict = PaginatedRuleList.from_dict(paginated_rule_list_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/PatchedDetectorRequest.md b/generated/docs/PatchedDetectorRequest.md
index eb594561..c240cb94 100644
--- a/generated/docs/PatchedDetectorRequest.md
+++ b/generated/docs/PatchedDetectorRequest.md
@@ -6,12 +6,28 @@ Groundlight Detectors provide answers to natural language questions about images
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | A short, descriptive name for the detector. | [optional]
-**confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] if omitted the server will use the default value of 0.9
-**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] if omitted the server will use the default value of 30.0
-**status** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
+**confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] [default to 0.9]
+**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] [default to 30.0]
+**status** | [**DetectorStatus**](DetectorStatus.md) | | [optional]
**escalation_type** | **str** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.patched_detector_request import PatchedDetectorRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PatchedDetectorRequest from a JSON string
+patched_detector_request_instance = PatchedDetectorRequest.from_json(json)
+# print the JSON string representation of the object
+print PatchedDetectorRequest.to_json()
+
+# convert the object into a dict
+patched_detector_request_dict = patched_detector_request_instance.to_dict()
+# create an instance of PatchedDetectorRequest from a dict
+patched_detector_request_from_dict = PatchedDetectorRequest.from_dict(patched_detector_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/PayloadTemplate.md b/generated/docs/PayloadTemplate.md
index b2f39495..4d70b726 100644
--- a/generated/docs/PayloadTemplate.md
+++ b/generated/docs/PayloadTemplate.md
@@ -5,9 +5,25 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**template** | **str** | |
-**headers** | **{str: (str,)}, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**headers** | **Dict[str, str]** | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.payload_template import PayloadTemplate
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PayloadTemplate from a JSON string
+payload_template_instance = PayloadTemplate.from_json(json)
+# print the JSON string representation of the object
+print PayloadTemplate.to_json()
+
+# convert the object into a dict
+payload_template_dict = payload_template_instance.to_dict()
+# create an instance of PayloadTemplate from a dict
+payload_template_from_dict = PayloadTemplate.from_dict(payload_template_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/PayloadTemplateRequest.md b/generated/docs/PayloadTemplateRequest.md
index 83e8c3c3..6fb0ae39 100644
--- a/generated/docs/PayloadTemplateRequest.md
+++ b/generated/docs/PayloadTemplateRequest.md
@@ -5,9 +5,25 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**template** | **str** | |
-**headers** | **{str: (str,)}, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**headers** | **Dict[str, str]** | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.payload_template_request import PayloadTemplateRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of PayloadTemplateRequest from a JSON string
+payload_template_request_instance = PayloadTemplateRequest.from_json(json)
+# print the JSON string representation of the object
+print PayloadTemplateRequest.to_json()
+
+# convert the object into a dict
+payload_template_request_dict = payload_template_request_instance.to_dict()
+# create an instance of PayloadTemplateRequest from a dict
+payload_template_request_from_dict = PayloadTemplateRequest.from_dict(payload_template_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/ROI.md b/generated/docs/ROI.md
index 60da87e6..0bb43e60 100644
--- a/generated/docs/ROI.md
+++ b/generated/docs/ROI.md
@@ -8,8 +8,24 @@ Name | Type | Description | Notes
**label** | **str** | The label of the bounding box. |
**score** | **float** | The confidence of the bounding box. | [readonly]
**geometry** | [**BBoxGeometry**](BBoxGeometry.md) | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.roi import ROI
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ROI from a JSON string
+roi_instance = ROI.from_json(json)
+# print the JSON string representation of the object
+print ROI.to_json()
+
+# convert the object into a dict
+roi_dict = roi_instance.to_dict()
+# create an instance of ROI from a dict
+roi_from_dict = ROI.from_dict(roi_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/ROIRequest.md b/generated/docs/ROIRequest.md
index 8d675ec3..271abcdc 100644
--- a/generated/docs/ROIRequest.md
+++ b/generated/docs/ROIRequest.md
@@ -7,8 +7,24 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | **str** | The label of the bounding box. |
**geometry** | [**BBoxGeometryRequest**](BBoxGeometryRequest.md) | |
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.roi_request import ROIRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of ROIRequest from a JSON string
+roi_request_instance = ROIRequest.from_json(json)
+# print the JSON string representation of the object
+print ROIRequest.to_json()
+
+# convert the object into a dict
+roi_request_dict = roi_request_instance.to_dict()
+# create an instance of ROIRequest from a dict
+roi_request_from_dict = ROIRequest.from_dict(roi_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/ResultTypeEnum.md b/generated/docs/ResultTypeEnum.md
index 0146b794..c38a2c4b 100644
--- a/generated/docs/ResultTypeEnum.md
+++ b/generated/docs/ResultTypeEnum.md
@@ -1,10 +1,17 @@
# ResultTypeEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ]
+## Enum
+
+* `BINARY_CLASSIFICATION` (value: `'binary_classification'`)
+
+* `COUNTING` (value: `'counting'`)
+
+* `MULTI_CLASSIFICATION` (value: `'multi_classification'`)
+
+* `TEXT_RECOGNITION` (value: `'text_recognition'`)
+
+* `BOUNDING_BOX` (value: `'bounding_box'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/Rule.md b/generated/docs/Rule.md
index a3f0c9d5..d5799096 100644
--- a/generated/docs/Rule.md
+++ b/generated/docs/Rule.md
@@ -8,16 +8,32 @@ Name | Type | Description | Notes
**detector_id** | **str** | | [readonly]
**detector_name** | **str** | | [readonly]
**name** | **str** | |
+**enabled** | **bool** | | [optional] [default to True]
+**snooze_time_enabled** | **bool** | | [optional] [default to False]
+**snooze_time_value** | **int** | | [optional] [default to 0]
+**snooze_time_unit** | [**SnoozeTimeUnitEnum**](SnoozeTimeUnitEnum.md) | | [optional]
+**human_review_required** | **bool** | | [optional] [default to False]
**condition** | [**Condition**](Condition.md) | |
-**enabled** | **bool** | | [optional] if omitted the server will use the default value of True
-**snooze_time_enabled** | **bool** | | [optional] if omitted the server will use the default value of False
-**snooze_time_value** | **int** | | [optional] if omitted the server will use the default value of 0
-**snooze_time_unit** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**human_review_required** | **bool** | | [optional] if omitted the server will use the default value of False
-**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**webhook_action** | [**[WebhookAction]**](WebhookAction.md) | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**action** | [**RuleAction**](RuleAction.md) | | [optional]
+**webhook_action** | [**List[WebhookAction]**](WebhookAction.md) | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.rule import Rule
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of Rule from a JSON string
+rule_instance = Rule.from_json(json)
+# print the JSON string representation of the object
+print Rule.to_json()
+
+# convert the object into a dict
+rule_dict = rule_instance.to_dict()
+# create an instance of Rule from a dict
+rule_from_dict = Rule.from_dict(rule_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/RuleAction.md b/generated/docs/RuleAction.md
new file mode 100644
index 00000000..474e9e13
--- /dev/null
+++ b/generated/docs/RuleAction.md
@@ -0,0 +1,30 @@
+# RuleAction
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**channel** | [**ChannelEnum**](ChannelEnum.md) | |
+**recipient** | **str** | |
+**include_image** | **bool** | |
+
+## Example
+
+```python
+from groundlight_openapi_client.models.rule_action import RuleAction
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of RuleAction from a JSON string
+rule_action_instance = RuleAction.from_json(json)
+# print the JSON string representation of the object
+print RuleAction.to_json()
+
+# convert the object into a dict
+rule_action_dict = rule_action_instance.to_dict()
+# create an instance of RuleAction from a dict
+rule_action_from_dict = RuleAction.from_dict(rule_action_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/docs/RuleRequest.md b/generated/docs/RuleRequest.md
index 9e5b3294..9058f4c6 100644
--- a/generated/docs/RuleRequest.md
+++ b/generated/docs/RuleRequest.md
@@ -5,16 +5,32 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | |
+**enabled** | **bool** | | [optional] [default to True]
+**snooze_time_enabled** | **bool** | | [optional] [default to False]
+**snooze_time_value** | **int** | | [optional] [default to 0]
+**snooze_time_unit** | [**SnoozeTimeUnitEnum**](SnoozeTimeUnitEnum.md) | | [optional]
+**human_review_required** | **bool** | | [optional] [default to False]
**condition** | [**ConditionRequest**](ConditionRequest.md) | |
-**enabled** | **bool** | | [optional] if omitted the server will use the default value of True
-**snooze_time_enabled** | **bool** | | [optional] if omitted the server will use the default value of False
-**snooze_time_value** | **int** | | [optional] if omitted the server will use the default value of 0
-**snooze_time_unit** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**human_review_required** | **bool** | | [optional] if omitted the server will use the default value of False
-**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
-**webhook_action** | [**[WebhookActionRequest]**](WebhookActionRequest.md) | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**action** | [**RuleAction**](RuleAction.md) | | [optional]
+**webhook_action** | [**List[WebhookActionRequest]**](WebhookActionRequest.md) | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.rule_request import RuleRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of RuleRequest from a JSON string
+rule_request_instance = RuleRequest.from_json(json)
+# print the JSON string representation of the object
+print RuleRequest.to_json()
+
+# convert the object into a dict
+rule_request_dict = rule_request_instance.to_dict()
+# create an instance of RuleRequest from a dict
+rule_request_from_dict = RuleRequest.from_dict(rule_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/SnoozeTimeUnitEnum.md b/generated/docs/SnoozeTimeUnitEnum.md
index 778f7062..74e3d6ee 100644
--- a/generated/docs/SnoozeTimeUnitEnum.md
+++ b/generated/docs/SnoozeTimeUnitEnum.md
@@ -2,10 +2,15 @@
* `DAYS` - DAYS * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | * `DAYS` - DAYS * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS | must be one of ["DAYS", "HOURS", "MINUTES", "SECONDS", ]
+## Enum
+
+* `DAYS` (value: `'DAYS'`)
+
+* `HOURS` (value: `'HOURS'`)
+
+* `MINUTES` (value: `'MINUTES'`)
+
+* `SECONDS` (value: `'SECONDS'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/Source.md b/generated/docs/Source.md
index fa6f1066..de54ce8d 100644
--- a/generated/docs/Source.md
+++ b/generated/docs/Source.md
@@ -1,10 +1,19 @@
# Source
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ]
+## Enum
+
+* `STILL_PROCESSING` (value: `'STILL_PROCESSING'`)
+
+* `CLOUD` (value: `'CLOUD'`)
+
+* `USER` (value: `'USER'`)
+
+* `CLOUD_ENSEMBLE` (value: `'CLOUD_ENSEMBLE'`)
+
+* `ALGORITHM` (value: `'ALGORITHM'`)
+
+* `EDGE` (value: `'EDGE'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/SourceEnum.md b/generated/docs/SourceEnum.md
index a382414e..4acac60f 100644
--- a/generated/docs/SourceEnum.md
+++ b/generated/docs/SourceEnum.md
@@ -1,10 +1,23 @@
# SourceEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ]
+## Enum
+
+* `INITIAL_PLACEHOLDER` (value: `'INITIAL_PLACEHOLDER'`)
+
+* `CLOUD` (value: `'CLOUD'`)
+
+* `CUST` (value: `'CUST'`)
+
+* `HUMAN_CLOUD_ENSEMBLE` (value: `'HUMAN_CLOUD_ENSEMBLE'`)
+
+* `ALG` (value: `'ALG'`)
+
+* `ALG_REC` (value: `'ALG_REC'`)
+
+* `ALG_UNCLEAR` (value: `'ALG_UNCLEAR'`)
+
+* `EDGE` (value: `'EDGE'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/StatusEnum.md b/generated/docs/StatusEnum.md
index 6d4c3312..e158c9f1 100644
--- a/generated/docs/StatusEnum.md
+++ b/generated/docs/StatusEnum.md
@@ -2,10 +2,11 @@
* `ON` - ON * `OFF` - OFF
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | * `ON` - ON * `OFF` - OFF | must be one of ["ON", "OFF", ]
+## Enum
+
+* `ON` (value: `'ON'`)
+
+* `OFF` (value: `'OFF'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/TextModeConfiguration.md b/generated/docs/TextModeConfiguration.md
index 01bcfdf1..a4e7291c 100644
--- a/generated/docs/TextModeConfiguration.md
+++ b/generated/docs/TextModeConfiguration.md
@@ -5,8 +5,24 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value_max_length** | **int** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.text_mode_configuration import TextModeConfiguration
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TextModeConfiguration from a JSON string
+text_mode_configuration_instance = TextModeConfiguration.from_json(json)
+# print the JSON string representation of the object
+print TextModeConfiguration.to_json()
+
+# convert the object into a dict
+text_mode_configuration_dict = text_mode_configuration_instance.to_dict()
+# create an instance of TextModeConfiguration from a dict
+text_mode_configuration_from_dict = TextModeConfiguration.from_dict(text_mode_configuration_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/TextRecognitionResult.md b/generated/docs/TextRecognitionResult.md
index f518a26b..70580331 100644
--- a/generated/docs/TextRecognitionResult.md
+++ b/generated/docs/TextRecognitionResult.md
@@ -4,14 +4,30 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
-**text** | **str, none_type** | |
-**truncated** | **bool** | |
-**confidence** | **float, none_type** | | [optional]
+**confidence** | **float** | | [optional]
**source** | **str** | | [optional]
-**result_type** | **str** | | [optional] if omitted the server will use the default value of "text_recognition"
+**result_type** | **str** | | [optional]
**from_edge** | **bool** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**text** | **str** | |
+**truncated** | **bool** | |
+
+## Example
+
+```python
+from groundlight_openapi_client.models.text_recognition_result import TextRecognitionResult
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of TextRecognitionResult from a JSON string
+text_recognition_result_instance = TextRecognitionResult.from_json(json)
+# print the JSON string representation of the object
+print TextRecognitionResult.to_json()
+# convert the object into a dict
+text_recognition_result_dict = text_recognition_result_instance.to_dict()
+# create an instance of TextRecognitionResult from a dict
+text_recognition_result_from_dict = TextRecognitionResult.from_dict(text_recognition_result_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/UserApi.md b/generated/docs/UserApi.md
index b10f06bc..0bcb0350 100644
--- a/generated/docs/UserApi.md
+++ b/generated/docs/UserApi.md
@@ -8,7 +8,7 @@ Method | HTTP request | Description
# **who_am_i**
-> InlineResponse2002 who_am_i()
+> WhoAmI200Response who_am_i()
@@ -17,13 +17,14 @@ Retrieve the current user.
### Example
* Api Key Authentication (ApiToken):
-
```python
import time
+import os
import groundlight_openapi_client
-from groundlight_openapi_client.api import user_api
-from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002
+from groundlight_openapi_client.models.who_am_i200_response import WhoAmI200Response
+from groundlight_openapi_client.rest import ApiException
from pprint import pprint
+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = groundlight_openapi_client.Configuration(
@@ -36,7 +37,7 @@ configuration = groundlight_openapi_client.Configuration(
# satisfies your auth use case.
# Configure API key authorization: ApiToken
-configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
+configuration.api_key['ApiToken'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
@@ -44,23 +45,24 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# Enter a context with an instance of the API client
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
- api_instance = user_api.UserApi(api_client)
+ api_instance = groundlight_openapi_client.UserApi(api_client)
- # example, this endpoint has no required or optional parameters
try:
api_response = api_instance.who_am_i()
+ print("The response of UserApi->who_am_i:\n")
pprint(api_response)
- except groundlight_openapi_client.ApiException as e:
+ except Exception as e:
print("Exception when calling UserApi->who_am_i: %s\n" % e)
```
+
### Parameters
This endpoint does not need any parameter.
### Return type
-[**InlineResponse2002**](InlineResponse2002.md)
+[**WhoAmI200Response**](WhoAmI200Response.md)
### Authorization
@@ -71,9 +73,7 @@ This endpoint does not need any parameter.
- **Content-Type**: Not defined
- **Accept**: application/json
-
### HTTP response details
-
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | | - |
diff --git a/generated/docs/VerbEnum.md b/generated/docs/VerbEnum.md
index 57a334c2..d010577d 100644
--- a/generated/docs/VerbEnum.md
+++ b/generated/docs/VerbEnum.md
@@ -1,10 +1,17 @@
# VerbEnum
-## Properties
-Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
-**value** | **str** | | must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ]
+## Enum
+
+* `ANSWERED_CONSECUTIVELY` (value: `'ANSWERED_CONSECUTIVELY'`)
+
+* `ANSWERED_WITHIN_TIME` (value: `'ANSWERED_WITHIN_TIME'`)
+
+* `CHANGED_TO` (value: `'CHANGED_TO'`)
+
+* `NO_CHANGE` (value: `'NO_CHANGE'`)
+
+* `NO_QUERIES` (value: `'NO_QUERIES'`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/WebhookAction.md b/generated/docs/WebhookAction.md
index 3635866d..ac391a34 100644
--- a/generated/docs/WebhookAction.md
+++ b/generated/docs/WebhookAction.md
@@ -6,12 +6,28 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**url** | **str** | |
**include_image** | **bool** | | [optional]
-**payload_template** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
+**payload_template** | [**PayloadTemplate**](PayloadTemplate.md) | | [optional]
**last_message_failed** | **bool** | | [optional]
-**last_failure_error** | **str, none_type** | | [optional]
-**last_failed_at** | **datetime, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**last_failure_error** | **str** | | [optional]
+**last_failed_at** | **datetime** | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.webhook_action import WebhookAction
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WebhookAction from a JSON string
+webhook_action_instance = WebhookAction.from_json(json)
+# print the JSON string representation of the object
+print WebhookAction.to_json()
+
+# convert the object into a dict
+webhook_action_dict = webhook_action_instance.to_dict()
+# create an instance of WebhookAction from a dict
+webhook_action_from_dict = WebhookAction.from_dict(webhook_action_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/WebhookActionRequest.md b/generated/docs/WebhookActionRequest.md
index 0910602a..919bc28d 100644
--- a/generated/docs/WebhookActionRequest.md
+++ b/generated/docs/WebhookActionRequest.md
@@ -6,12 +6,28 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**url** | **str** | |
**include_image** | **bool** | | [optional]
-**payload_template** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
+**payload_template** | [**PayloadTemplateRequest**](PayloadTemplateRequest.md) | | [optional]
**last_message_failed** | **bool** | | [optional]
-**last_failure_error** | **str, none_type** | | [optional]
-**last_failed_at** | **datetime, none_type** | | [optional]
-**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
+**last_failure_error** | **str** | | [optional]
+**last_failed_at** | **datetime** | | [optional]
+## Example
+
+```python
+from groundlight_openapi_client.models.webhook_action_request import WebhookActionRequest
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WebhookActionRequest from a JSON string
+webhook_action_request_instance = WebhookActionRequest.from_json(json)
+# print the JSON string representation of the object
+print WebhookActionRequest.to_json()
+
+# convert the object into a dict
+webhook_action_request_dict = webhook_action_request_instance.to_dict()
+# create an instance of WebhookActionRequest from a dict
+webhook_action_request_from_dict = WebhookActionRequest.from_dict(webhook_action_request_dict)
+```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
diff --git a/generated/docs/WhoAmI200Response.md b/generated/docs/WhoAmI200Response.md
new file mode 100644
index 00000000..5c6adccf
--- /dev/null
+++ b/generated/docs/WhoAmI200Response.md
@@ -0,0 +1,30 @@
+# WhoAmI200Response
+
+
+## Properties
+Name | Type | Description | Notes
+------------ | ------------- | ------------- | -------------
+**username** | **str** | The user's username | [optional]
+**email** | **str** | The user's email | [optional]
+**is_superuser** | **bool** | Whether the user is a superuser | [optional]
+
+## Example
+
+```python
+from groundlight_openapi_client.models.who_am_i200_response import WhoAmI200Response
+
+# TODO update the JSON string below
+json = "{}"
+# create an instance of WhoAmI200Response from a JSON string
+who_am_i200_response_instance = WhoAmI200Response.from_json(json)
+# print the JSON string representation of the object
+print WhoAmI200Response.to_json()
+
+# convert the object into a dict
+who_am_i200_response_dict = who_am_i200_response_instance.to_dict()
+# create an instance of WhoAmI200Response from a dict
+who_am_i200_response_from_dict = WhoAmI200Response.from_dict(who_am_i200_response_dict)
+```
+[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+
+
diff --git a/generated/groundlight_openapi_client/__init__.py b/generated/groundlight_openapi_client/__init__.py
index ff1e9a1d..e9aac5c5 100644
--- a/generated/groundlight_openapi_client/__init__.py
+++ b/generated/groundlight_openapi_client/__init__.py
@@ -1,28 +1,111 @@
+# coding: utf-8
+
# flake8: noqa
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
__version__ = "1.0.0"
+# import apis into sdk package
+from groundlight_openapi_client.api.actions_api import ActionsApi
+from groundlight_openapi_client.api.detector_groups_api import DetectorGroupsApi
+from groundlight_openapi_client.api.detector_reset_api import DetectorResetApi
+from groundlight_openapi_client.api.detectors_api import DetectorsApi
+from groundlight_openapi_client.api.edge_api import EdgeApi
+from groundlight_openapi_client.api.image_queries_api import ImageQueriesApi
+from groundlight_openapi_client.api.labels_api import LabelsApi
+from groundlight_openapi_client.api.notes_api import NotesApi
+from groundlight_openapi_client.api.user_api import UserApi
+
# import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
from groundlight_openapi_client.api_client import ApiClient
-
-# import Configuration
from groundlight_openapi_client.configuration import Configuration
-
-# import exceptions
from groundlight_openapi_client.exceptions import OpenApiException
-from groundlight_openapi_client.exceptions import ApiAttributeError
from groundlight_openapi_client.exceptions import ApiTypeError
from groundlight_openapi_client.exceptions import ApiValueError
from groundlight_openapi_client.exceptions import ApiKeyError
+from groundlight_openapi_client.exceptions import ApiAttributeError
from groundlight_openapi_client.exceptions import ApiException
+
+# import models into sdk package
+from groundlight_openapi_client.models.action import Action
+from groundlight_openapi_client.models.all_notes import AllNotes
+from groundlight_openapi_client.models.annotations_requested_enum import AnnotationsRequestedEnum
+from groundlight_openapi_client.models.b_box_geometry import BBoxGeometry
+from groundlight_openapi_client.models.b_box_geometry_request import BBoxGeometryRequest
+from groundlight_openapi_client.models.binary_classification_result import BinaryClassificationResult
+from groundlight_openapi_client.models.blank_enum import BlankEnum
+from groundlight_openapi_client.models.bounding_box_mode_configuration import BoundingBoxModeConfiguration
+from groundlight_openapi_client.models.bounding_box_result import BoundingBoxResult
+from groundlight_openapi_client.models.channel_enum import ChannelEnum
+from groundlight_openapi_client.models.condition import Condition
+from groundlight_openapi_client.models.condition_request import ConditionRequest
+from groundlight_openapi_client.models.count_mode_configuration import CountModeConfiguration
+from groundlight_openapi_client.models.counting_result import CountingResult
+from groundlight_openapi_client.models.detector import Detector
+from groundlight_openapi_client.models.detector_creation_input_request import DetectorCreationInputRequest
+from groundlight_openapi_client.models.detector_creation_input_request_mode_configuration import (
+ DetectorCreationInputRequestModeConfiguration,
+)
+from groundlight_openapi_client.models.detector_group import DetectorGroup
+from groundlight_openapi_client.models.detector_group_request import DetectorGroupRequest
+from groundlight_openapi_client.models.detector_status import DetectorStatus
+from groundlight_openapi_client.models.detector_type_enum import DetectorTypeEnum
+from groundlight_openapi_client.models.edge_model_info import EdgeModelInfo
+from groundlight_openapi_client.models.escalation_type_enum import EscalationTypeEnum
+from groundlight_openapi_client.models.get_detector_evaluation200_response import GetDetectorEvaluation200Response
+from groundlight_openapi_client.models.get_detector_evaluation200_response_evaluation_results import (
+ GetDetectorEvaluation200ResponseEvaluationResults,
+)
+from groundlight_openapi_client.models.get_detector_metrics200_response import GetDetectorMetrics200Response
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary import (
+ GetDetectorMetrics200ResponseSummary,
+)
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary_class_counts import (
+ GetDetectorMetrics200ResponseSummaryClassCounts,
+)
+from groundlight_openapi_client.models.image_query import ImageQuery
+from groundlight_openapi_client.models.image_query_result import ImageQueryResult
+from groundlight_openapi_client.models.image_query_type_enum import ImageQueryTypeEnum
+from groundlight_openapi_client.models.label import Label
+from groundlight_openapi_client.models.label_value import LabelValue
+from groundlight_openapi_client.models.label_value_request import LabelValueRequest
+from groundlight_openapi_client.models.mode_enum import ModeEnum
+from groundlight_openapi_client.models.multi_class_mode_configuration import MultiClassModeConfiguration
+from groundlight_openapi_client.models.multi_classification_result import MultiClassificationResult
+from groundlight_openapi_client.models.note import Note
+from groundlight_openapi_client.models.note_request import NoteRequest
+from groundlight_openapi_client.models.paginated_detector_list import PaginatedDetectorList
+from groundlight_openapi_client.models.paginated_image_query_list import PaginatedImageQueryList
+from groundlight_openapi_client.models.paginated_rule_list import PaginatedRuleList
+from groundlight_openapi_client.models.patched_detector_request import PatchedDetectorRequest
+from groundlight_openapi_client.models.payload_template import PayloadTemplate
+from groundlight_openapi_client.models.payload_template_request import PayloadTemplateRequest
+from groundlight_openapi_client.models.roi import ROI
+from groundlight_openapi_client.models.roi_request import ROIRequest
+from groundlight_openapi_client.models.result_type_enum import ResultTypeEnum
+from groundlight_openapi_client.models.rule import Rule
+from groundlight_openapi_client.models.rule_action import RuleAction
+from groundlight_openapi_client.models.rule_request import RuleRequest
+from groundlight_openapi_client.models.snooze_time_unit_enum import SnoozeTimeUnitEnum
+from groundlight_openapi_client.models.source import Source
+from groundlight_openapi_client.models.source_enum import SourceEnum
+from groundlight_openapi_client.models.status_enum import StatusEnum
+from groundlight_openapi_client.models.text_mode_configuration import TextModeConfiguration
+from groundlight_openapi_client.models.text_recognition_result import TextRecognitionResult
+from groundlight_openapi_client.models.verb_enum import VerbEnum
+from groundlight_openapi_client.models.webhook_action import WebhookAction
+from groundlight_openapi_client.models.webhook_action_request import WebhookActionRequest
+from groundlight_openapi_client.models.who_am_i200_response import WhoAmI200Response
diff --git a/generated/groundlight_openapi_client/api/__init__.py b/generated/groundlight_openapi_client/api/__init__.py
index 895d519d..46ea63d6 100644
--- a/generated/groundlight_openapi_client/api/__init__.py
+++ b/generated/groundlight_openapi_client/api/__init__.py
@@ -1,3 +1,12 @@
-# do not import all apis into this module because that uses a lot of memory and stack frames
-# if you need the ability to import all apis from one package, import them with
-# from groundlight_openapi_client.apis import ActionsApi
+# flake8: noqa
+
+# import apis into api package
+from groundlight_openapi_client.api.actions_api import ActionsApi
+from groundlight_openapi_client.api.detector_groups_api import DetectorGroupsApi
+from groundlight_openapi_client.api.detector_reset_api import DetectorResetApi
+from groundlight_openapi_client.api.detectors_api import DetectorsApi
+from groundlight_openapi_client.api.edge_api import EdgeApi
+from groundlight_openapi_client.api.image_queries_api import ImageQueriesApi
+from groundlight_openapi_client.api.labels_api import LabelsApi
+from groundlight_openapi_client.api.notes_api import NotesApi
+from groundlight_openapi_client.api.user_api import UserApi
diff --git a/generated/groundlight_openapi_client/api/actions_api.py b/generated/groundlight_openapi_client/api/actions_api.py
index 4f9d42f5..9586e1c8 100644
--- a/generated/groundlight_openapi_client/api/actions_api.py
+++ b/generated/groundlight_openapi_client/api/actions_api.py
@@ -1,258 +1,52 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.paginated_rule_list import PaginatedRuleList
-from groundlight_openapi_client.model.rule import Rule
-from groundlight_openapi_client.model.rule_request import RuleRequest
-
-
-class ActionsApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from typing_extensions import Annotated
+from pydantic import Field, StrictInt, StrictStr
+
+from typing import Optional
+
+from groundlight_openapi_client.models.paginated_rule_list import PaginatedRuleList
+from groundlight_openapi_client.models.rule import Rule
+from groundlight_openapi_client.models.rule_request import RuleRequest
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class ActionsApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.create_rule_endpoint = _Endpoint(
- settings={
- "response_type": (Rule,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/actions/detector/{detector_id}/rules",
- "operation_id": "create_rule",
- "http_method": "POST",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- "rule_request",
- ],
- "required": [
- "detector_id",
- "rule_request",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- "rule_request": (RuleRequest,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- },
- "location_map": {
- "detector_id": "path",
- "rule_request": "body",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"],
- },
- api_client=api_client,
- )
- self.delete_rule_endpoint = _Endpoint(
- settings={
- "response_type": None,
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/actions/rules/{id}",
- "operation_id": "delete_rule",
- "http_method": "DELETE",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (int,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": [],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.get_rule_endpoint = _Endpoint(
- settings={
- "response_type": (Rule,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/actions/rules/{id}",
- "operation_id": "get_rule",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (int,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.list_detector_rules_endpoint = _Endpoint(
- settings={
- "response_type": (PaginatedRuleList,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/actions/detector/{detector_id}/rules",
- "operation_id": "list_detector_rules",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- "page",
- "page_size",
- ],
- "required": [
- "detector_id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- "page": (int,),
- "page_size": (int,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- "page": "page",
- "page_size": "page_size",
- },
- "location_map": {
- "detector_id": "path",
- "page": "query",
- "page_size": "query",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.list_rules_endpoint = _Endpoint(
- settings={
- "response_type": (PaginatedRuleList,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/actions/rules",
- "operation_id": "list_rules",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "page",
- "page_size",
- ],
- "required": [],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "page": (int,),
- "page_size": (int,),
- },
- "attribute_map": {
- "page": "page",
- "page_size": "page_size",
- },
- "location_map": {
- "page": "query",
- "page_size": "query",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- def create_rule(self, detector_id, rule_request, **kwargs):
+ @validate_arguments
+ def create_rule(self, detector_id: StrictStr, rule_request: RuleRequest, **kwargs) -> Rule: # noqa: E501
"""create_rule # noqa: E501
Create a new rule for a detector # noqa: E501
@@ -262,57 +56,149 @@ def create_rule(self, detector_id, rule_request, **kwargs):
>>> thread = api.create_rule(detector_id, rule_request, async_req=True)
>>> result = thread.get()
- Args:
- detector_id (str):
- rule_request (RuleRequest):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Rule
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: (required)
+ :type detector_id: str
+ :param rule_request: (required)
+ :type rule_request: RuleRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Rule
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the create_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.create_rule_with_http_info(detector_id, rule_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_rule_with_http_info(
+ self, detector_id: StrictStr, rule_request: RuleRequest, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """create_rule # noqa: E501
+
+ Create a new rule for a detector # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_rule_with_http_info(detector_id, rule_request, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_id: (required)
+ :type detector_id: str
+ :param rule_request: (required)
+ :type rule_request: RuleRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Rule, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_id"] = detector_id
- kwargs["rule_request"] = rule_request
- return self.create_rule_endpoint.call_with_http_info(**kwargs)
-
- def delete_rule(self, id, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["detector_id", "rule_request"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method create_rule" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["detector_id"] is not None:
+ _path_params["detector_id"] = _params["detector_id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["rule_request"] is not None:
+ _body_params = _params["rule_request"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
+ ),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "201": "Rule",
+ }
+
+ return self.api_client.call_api(
+ "/v1/actions/detector/{detector_id}/rules",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def delete_rule(self, id: StrictInt, **kwargs) -> None: # noqa: E501
"""delete_rule # noqa: E501
Delete a rule # noqa: E501
@@ -322,55 +208,125 @@ def delete_rule(self, id, **kwargs):
>>> thread = api.delete_rule(id, async_req=True)
>>> result = thread.get()
- Args:
- id (int):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
+ :param id: (required)
+ :type id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the delete_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.delete_rule_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_rule_with_http_info(self, id: StrictInt, **kwargs) -> ApiResponse: # noqa: E501
+ """delete_rule # noqa: E501
+
+ Delete a rule # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_rule_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: (required)
+ :type id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.delete_rule_endpoint.call_with_http_info(**kwargs)
-
- def get_rule(self, id, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method delete_rule" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/v1/actions/rules/{id}",
+ "DELETE",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_rule(self, id: StrictInt, **kwargs) -> Rule: # noqa: E501
"""get_rule # noqa: E501
Retrieve a rule # noqa: E501
@@ -380,167 +336,442 @@ def get_rule(self, id, **kwargs):
>>> thread = api.get_rule(id, async_req=True)
>>> result = thread.get()
- Args:
- id (int):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Rule
- If the method is called asynchronously, returns the request
- thread.
+ :param id: (required)
+ :type id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Rule
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_rule_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_rule_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_rule_with_http_info(self, id: StrictInt, **kwargs) -> ApiResponse: # noqa: E501
+ """get_rule # noqa: E501
+
+ Retrieve a rule # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_rule_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: (required)
+ :type id: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Rule, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_rule" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "Rule",
+ }
+
+ return self.api_client.call_api(
+ "/v1/actions/rules/{id}",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def list_detector_rules(
+ self,
+ detector_id: StrictStr,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
+ **kwargs,
+ ) -> PaginatedRuleList: # noqa: E501
+ """list_detector_rules # noqa: E501
+
+ List all rules for a detector # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_detector_rules(detector_id, page, page_size, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_id: (required)
+ :type detector_id: str
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of results to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: PaginatedRuleList
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.get_rule_endpoint.call_with_http_info(**kwargs)
-
- def list_detector_rules(self, detector_id, **kwargs):
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the list_detector_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.list_detector_rules_with_http_info(detector_id, page, page_size, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_detector_rules_with_http_info(
+ self,
+ detector_id: StrictStr,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
"""list_detector_rules # noqa: E501
List all rules for a detector # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.list_detector_rules(detector_id, async_req=True)
+ >>> thread = api.list_detector_rules_with_http_info(detector_id, page, page_size, async_req=True)
>>> result = thread.get()
- Args:
- detector_id (str):
-
- Keyword Args:
- page (int): A page number within the paginated result set.. [optional]
- page_size (int): Number of results to return per page.. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- PaginatedRuleList
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: (required)
+ :type detector_id: str
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of results to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(PaginatedRuleList, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_id"] = detector_id
- return self.list_detector_rules_endpoint.call_with_http_info(**kwargs)
-
- def list_rules(self, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["detector_id", "page", "page_size"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method list_detector_rules" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["detector_id"] is not None:
+ _path_params["detector_id"] = _params["detector_id"]
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("page") is not None: # noqa: E501
+ _query_params.append(("page", _params["page"]))
+
+ if _params.get("page_size") is not None: # noqa: E501
+ _query_params.append(("page_size", _params["page_size"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "PaginatedRuleList",
+ }
+
+ return self.api_client.call_api(
+ "/v1/actions/detector/{detector_id}/rules",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def list_rules(
+ self,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
+ **kwargs,
+ ) -> PaginatedRuleList: # noqa: E501
"""list_rules # noqa: E501
Lists all rules over all detectors owned by the requester. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.list_rules(async_req=True)
+ >>> thread = api.list_rules(page, page_size, async_req=True)
>>> result = thread.get()
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of results to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: PaginatedRuleList
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the list_rules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.list_rules_with_http_info(page, page_size, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_rules_with_http_info(
+ self,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of results to return per page.")] = None,
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
+ """list_rules # noqa: E501
+
+ Lists all rules over all detectors owned by the requester. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
- Keyword Args:
- page (int): A page number within the paginated result set.. [optional]
- page_size (int): Number of results to return per page.. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- PaginatedRuleList
- If the method is called asynchronously, returns the request
- thread.
+ >>> thread = api.list_rules_with_http_info(page, page_size, async_req=True)
+ >>> result = thread.get()
+
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of results to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(PaginatedRuleList, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- return self.list_rules_endpoint.call_with_http_info(**kwargs)
+
+ _params = locals()
+
+ _all_params = ["page", "page_size"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method list_rules" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("page") is not None: # noqa: E501
+ _query_params.append(("page", _params["page"]))
+
+ if _params.get("page_size") is not None: # noqa: E501
+ _query_params.append(("page_size", _params["page_size"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "PaginatedRuleList",
+ }
+
+ return self.api_client.call_api(
+ "/v1/actions/rules",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/detector_groups_api.py b/generated/groundlight_openapi_client/api/detector_groups_api.py
index 83a2cb4f..967b5888 100644
--- a/generated/groundlight_openapi_client/api/detector_groups_api.py
+++ b/generated/groundlight_openapi_client/api/detector_groups_api.py
@@ -1,105 +1,50 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.detector_group import DetectorGroup
-from groundlight_openapi_client.model.detector_group_request import DetectorGroupRequest
-
-
-class DetectorGroupsApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from typing import List
+
+from groundlight_openapi_client.models.detector_group import DetectorGroup
+from groundlight_openapi_client.models.detector_group_request import DetectorGroupRequest
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class DetectorGroupsApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.create_detector_group_endpoint = _Endpoint(
- settings={
- "response_type": (DetectorGroup,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detector-groups",
- "operation_id": "create_detector_group",
- "http_method": "POST",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_group_request",
- ],
- "required": [
- "detector_group_request",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_group_request": (DetectorGroupRequest,),
- },
- "attribute_map": {},
- "location_map": {
- "detector_group_request": "body",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"],
- },
- api_client=api_client,
- )
- self.get_detector_groups_endpoint = _Endpoint(
- settings={
- "response_type": ([DetectorGroup],),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detector-groups",
- "operation_id": "get_detector_groups",
- "http_method": "GET",
- "servers": None,
- },
- params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {},
- "attribute_map": {},
- "location_map": {},
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- def create_detector_group(self, detector_group_request, **kwargs):
+ @validate_arguments
+ def create_detector_group(
+ self, detector_group_request: DetectorGroupRequest, **kwargs
+ ) -> DetectorGroup: # noqa: E501
"""create_detector_group # noqa: E501
Create a new detector group POST data: Required: - name (str) - name of the predictor set # noqa: E501
@@ -109,55 +54,143 @@ def create_detector_group(self, detector_group_request, **kwargs):
>>> thread = api.create_detector_group(detector_group_request, async_req=True)
>>> result = thread.get()
- Args:
- detector_group_request (DetectorGroupRequest):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- DetectorGroup
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_group_request: (required)
+ :type detector_group_request: DetectorGroupRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: DetectorGroup
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the create_detector_group_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.create_detector_group_with_http_info(detector_group_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_detector_group_with_http_info(
+ self, detector_group_request: DetectorGroupRequest, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """create_detector_group # noqa: E501
+
+ Create a new detector group POST data: Required: - name (str) - name of the predictor set # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_detector_group_with_http_info(detector_group_request, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_group_request: (required)
+ :type detector_group_request: DetectorGroupRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(DetectorGroup, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_group_request"] = detector_group_request
- return self.create_detector_group_endpoint.call_with_http_info(**kwargs)
-
- def get_detector_groups(self, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["detector_group_request"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method create_detector_group" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["detector_group_request"] is not None:
+ _body_params = _params["detector_group_request"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
+ ),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "201": "DetectorGroup",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detector-groups",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_detector_groups(self, **kwargs) -> List[DetectorGroup]: # noqa: E501
"""get_detector_groups # noqa: E501
List all detector groups # noqa: E501
@@ -167,47 +200,118 @@ def get_detector_groups(self, **kwargs):
>>> thread = api.get_detector_groups(async_req=True)
>>> result = thread.get()
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: List[DetectorGroup]
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_detector_groups_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_detector_groups_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_detector_groups_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
+ """get_detector_groups # noqa: E501
+
+ List all detector groups # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_detector_groups_with_http_info(async_req=True)
+ >>> result = thread.get()
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- [DetectorGroup]
- If the method is called asynchronously, returns the request
- thread.
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(List[DetectorGroup], status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- return self.get_detector_groups_endpoint.call_with_http_info(**kwargs)
+
+ _params = locals()
+
+ _all_params = []
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_detector_groups" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "List[DetectorGroup]",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detector-groups",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/detector_reset_api.py b/generated/groundlight_openapi_client/api/detector_reset_api.py
index c50532f8..5c5ab2ee 100644
--- a/generated/groundlight_openapi_client/api/detector_reset_api.py
+++ b/generated/groundlight_openapi_client/api/detector_reset_api.py
@@ -1,81 +1,46 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from pydantic import StrictStr
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
-class DetectorResetApi(object):
+
+class DetectorResetApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.reset_detector_endpoint = _Endpoint(
- settings={
- "response_type": None,
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detector-reset/{id}",
- "operation_id": "reset_detector",
- "http_method": "DELETE",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (str,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": [],
- "content_type": [],
- },
- api_client=api_client,
- )
- def reset_detector(self, id, **kwargs):
+ @validate_arguments
+ def reset_detector(self, id: StrictStr, **kwargs) -> None: # noqa: E501
"""reset_detector # noqa: E501
Deletes all image queries on the detector # noqa: E501
@@ -85,50 +50,119 @@ def reset_detector(self, id, **kwargs):
>>> thread = api.reset_detector(id, async_req=True)
>>> result = thread.get()
- Args:
- id (str):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
+ :param id: (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the reset_detector_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.reset_detector_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def reset_detector_with_http_info(self, id: StrictStr, **kwargs) -> ApiResponse: # noqa: E501
+ """reset_detector # noqa: E501
+
+ Deletes all image queries on the detector # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.reset_detector_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.reset_detector_endpoint.call_with_http_info(**kwargs)
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method reset_detector" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/v1/detector-reset/{id}",
+ "DELETE",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/detectors_api.py b/generated/groundlight_openapi_client/api/detectors_api.py
index eca18f45..09a5236b 100644
--- a/generated/groundlight_openapi_client/api/detectors_api.py
+++ b/generated/groundlight_openapi_client/api/detectors_api.py
@@ -1,327 +1,57 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.detector import Detector
-from groundlight_openapi_client.model.detector_creation_input_request import DetectorCreationInputRequest
-from groundlight_openapi_client.model.inline_response200 import InlineResponse200
-from groundlight_openapi_client.model.inline_response2001 import InlineResponse2001
-from groundlight_openapi_client.model.paginated_detector_list import PaginatedDetectorList
-from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest
-
-
-class DetectorsApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from typing_extensions import Annotated
+from pydantic import Field, StrictInt, StrictStr
+
+from typing import Optional
+
+from groundlight_openapi_client.models.detector import Detector
+from groundlight_openapi_client.models.detector_creation_input_request import DetectorCreationInputRequest
+from groundlight_openapi_client.models.get_detector_evaluation200_response import GetDetectorEvaluation200Response
+from groundlight_openapi_client.models.get_detector_metrics200_response import GetDetectorMetrics200Response
+from groundlight_openapi_client.models.paginated_detector_list import PaginatedDetectorList
+from groundlight_openapi_client.models.patched_detector_request import PatchedDetectorRequest
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class DetectorsApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.create_detector_endpoint = _Endpoint(
- settings={
- "response_type": (Detector,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detectors",
- "operation_id": "create_detector",
- "http_method": "POST",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_creation_input_request",
- ],
- "required": [
- "detector_creation_input_request",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_creation_input_request": (DetectorCreationInputRequest,),
- },
- "attribute_map": {},
- "location_map": {
- "detector_creation_input_request": "body",
- },
- "collection_format_map": {},
- },
- headers_map={"accept": ["application/json"], "content_type": ["application/json"]},
- api_client=api_client,
- )
- self.delete_detector_endpoint = _Endpoint(
- settings={
- "response_type": None,
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detectors/{id}",
- "operation_id": "delete_detector",
- "http_method": "DELETE",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (str,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": [],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.get_detector_endpoint = _Endpoint(
- settings={
- "response_type": (Detector,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detectors/{id}",
- "operation_id": "get_detector",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (str,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.get_detector_evaluation_endpoint = _Endpoint(
- settings={
- "response_type": (InlineResponse2001,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detectors/{id}/evaluation",
- "operation_id": "get_detector_evaluation",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (str,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.get_detector_metrics_endpoint = _Endpoint(
- settings={
- "response_type": (InlineResponse200,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detectors/{detector_id}/metrics",
- "operation_id": "get_detector_metrics",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- ],
- "required": [
- "detector_id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- },
- "location_map": {
- "detector_id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.list_detectors_endpoint = _Endpoint(
- settings={
- "response_type": (PaginatedDetectorList,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detectors",
- "operation_id": "list_detectors",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "page",
- "page_size",
- ],
- "required": [],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "page": (int,),
- "page_size": (int,),
- },
- "attribute_map": {
- "page": "page",
- "page_size": "page_size",
- },
- "location_map": {
- "page": "query",
- "page_size": "query",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.update_detector_endpoint = _Endpoint(
- settings={
- "response_type": (Detector,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/detectors/{id}",
- "operation_id": "update_detector",
- "http_method": "PATCH",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- "patched_detector_request",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (str,),
- "patched_detector_request": (PatchedDetectorRequest,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- "patched_detector_request": "body",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"],
- },
- api_client=api_client,
- )
- def create_detector(self, detector_creation_input_request, **kwargs):
+ @validate_arguments
+ def create_detector(
+ self, detector_creation_input_request: DetectorCreationInputRequest, **kwargs
+ ) -> Detector: # noqa: E501
"""create_detector # noqa: E501
Create a new detector. # noqa: E501
@@ -331,55 +61,141 @@ def create_detector(self, detector_creation_input_request, **kwargs):
>>> thread = api.create_detector(detector_creation_input_request, async_req=True)
>>> result = thread.get()
- Args:
- detector_creation_input_request (DetectorCreationInputRequest):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Detector
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_creation_input_request: (required)
+ :type detector_creation_input_request: DetectorCreationInputRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Detector
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_creation_input_request"] = detector_creation_input_request
- return self.create_detector_endpoint.call_with_http_info(**kwargs)
-
- def delete_detector(self, id, **kwargs):
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the create_detector_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.create_detector_with_http_info(detector_creation_input_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_detector_with_http_info(
+ self, detector_creation_input_request: DetectorCreationInputRequest, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """create_detector # noqa: E501
+
+ Create a new detector. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_detector_with_http_info(detector_creation_input_request, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_creation_input_request: (required)
+ :type detector_creation_input_request: DetectorCreationInputRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Detector, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["detector_creation_input_request"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method create_detector" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["detector_creation_input_request"] is not None:
+ _body_params = _params["detector_creation_input_request"]
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type", self.api_client.select_header_content_type(["application/json"])
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "201": "Detector",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detectors",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def delete_detector(
+ self, id: Annotated[StrictStr, Field(..., description="Choose a detector by its ID.")], **kwargs
+ ) -> None: # noqa: E501
"""delete_detector # noqa: E501
Delete a detector by its ID. # noqa: E501
@@ -389,55 +205,129 @@ def delete_detector(self, id, **kwargs):
>>> thread = api.delete_detector(id, async_req=True)
>>> result = thread.get()
- Args:
- id (str): Choose a detector by its ID.
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
+ :param id: Choose a detector by its ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.delete_detector_endpoint.call_with_http_info(**kwargs)
-
- def get_detector(self, id, **kwargs):
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the delete_detector_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.delete_detector_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def delete_detector_with_http_info(
+ self, id: Annotated[StrictStr, Field(..., description="Choose a detector by its ID.")], **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """delete_detector # noqa: E501
+
+ Delete a detector by its ID. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.delete_detector_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: Choose a detector by its ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method delete_detector" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/v1/detectors/{id}",
+ "DELETE",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_detector(
+ self, id: Annotated[StrictStr, Field(..., description="Choose a detector by its ID.")], **kwargs
+ ) -> Detector: # noqa: E501
"""get_detector # noqa: E501
Retrieve a detector by its ID. # noqa: E501
@@ -447,55 +337,132 @@ def get_detector(self, id, **kwargs):
>>> thread = api.get_detector(id, async_req=True)
>>> result = thread.get()
- Args:
- id (str): Choose a detector by its ID.
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Detector
- If the method is called asynchronously, returns the request
- thread.
+ :param id: Choose a detector by its ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Detector
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_detector_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_detector_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_detector_with_http_info(
+ self, id: Annotated[StrictStr, Field(..., description="Choose a detector by its ID.")], **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """get_detector # noqa: E501
+
+ Retrieve a detector by its ID. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_detector_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: Choose a detector by its ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Detector, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.get_detector_endpoint.call_with_http_info(**kwargs)
-
- def get_detector_evaluation(self, id, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_detector" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "Detector",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detectors/{id}",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_detector_evaluation(self, id: StrictStr, **kwargs) -> GetDetectorEvaluation200Response: # noqa: E501
"""get_detector_evaluation # noqa: E501
Get Detector evaluation results. The result is null if there isn't enough ground truth data to evaluate the detector. Returns the time of the evaulation, total ground truth labels, the ml based kfold accuracies, and the system accuracies at different confidence thresholds # noqa: E501
@@ -505,55 +472,130 @@ def get_detector_evaluation(self, id, **kwargs):
>>> thread = api.get_detector_evaluation(id, async_req=True)
>>> result = thread.get()
- Args:
- id (str):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- InlineResponse2001
- If the method is called asynchronously, returns the request
- thread.
+ :param id: (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: GetDetectorEvaluation200Response
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_detector_evaluation_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_detector_evaluation_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_detector_evaluation_with_http_info(self, id: StrictStr, **kwargs) -> ApiResponse: # noqa: E501
+ """get_detector_evaluation # noqa: E501
+
+ Get Detector evaluation results. The result is null if there isn't enough ground truth data to evaluate the detector. Returns the time of the evaulation, total ground truth labels, the ml based kfold accuracies, and the system accuracies at different confidence thresholds # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_detector_evaluation_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(GetDetectorEvaluation200Response, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.get_detector_evaluation_endpoint.call_with_http_info(**kwargs)
-
- def get_detector_metrics(self, detector_id, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_detector_evaluation" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "GetDetectorEvaluation200Response",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detectors/{id}/evaluation",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_detector_metrics(self, detector_id: StrictStr, **kwargs) -> GetDetectorMetrics200Response: # noqa: E501
"""get_detector_metrics # noqa: E501
Get Detector metrics, primarily the counts of different types of labels # noqa: E501
@@ -563,166 +605,433 @@ def get_detector_metrics(self, detector_id, **kwargs):
>>> thread = api.get_detector_metrics(detector_id, async_req=True)
>>> result = thread.get()
- Args:
- detector_id (str):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- InlineResponse200
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: (required)
+ :type detector_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: GetDetectorMetrics200Response
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_id"] = detector_id
- return self.get_detector_metrics_endpoint.call_with_http_info(**kwargs)
-
- def list_detectors(self, **kwargs):
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_detector_metrics_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_detector_metrics_with_http_info(detector_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_detector_metrics_with_http_info(self, detector_id: StrictStr, **kwargs) -> ApiResponse: # noqa: E501
+ """get_detector_metrics # noqa: E501
+
+ Get Detector metrics, primarily the counts of different types of labels # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_detector_metrics_with_http_info(detector_id, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_id: (required)
+ :type detector_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(GetDetectorMetrics200Response, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["detector_id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_detector_metrics" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["detector_id"] is not None:
+ _path_params["detector_id"] = _params["detector_id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "GetDetectorMetrics200Response",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detectors/{detector_id}/metrics",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def list_detectors(
+ self,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of items to return per page.")] = None,
+ **kwargs,
+ ) -> PaginatedDetectorList: # noqa: E501
"""list_detectors # noqa: E501
Retrieve a list of detectors. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.list_detectors(async_req=True)
+ >>> thread = api.list_detectors(page, page_size, async_req=True)
>>> result = thread.get()
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of items to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: PaginatedDetectorList
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the list_detectors_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.list_detectors_with_http_info(page, page_size, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_detectors_with_http_info(
+ self,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of items to return per page.")] = None,
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
+ """list_detectors # noqa: E501
- Keyword Args:
- page (int): A page number within the paginated result set.. [optional]
- page_size (int): Number of items to return per page.. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- PaginatedDetectorList
- If the method is called asynchronously, returns the request
- thread.
+ Retrieve a list of detectors. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_detectors_with_http_info(page, page_size, async_req=True)
+ >>> result = thread.get()
+
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of items to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(PaginatedDetectorList, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["page", "page_size"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method list_detectors" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("page") is not None: # noqa: E501
+ _query_params.append(("page", _params["page"]))
+
+ if _params.get("page_size") is not None: # noqa: E501
+ _query_params.append(("page_size", _params["page_size"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "PaginatedDetectorList",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detectors",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def update_detector(
+ self, id: StrictStr, patched_detector_request: Optional[PatchedDetectorRequest] = None, **kwargs
+ ) -> Detector: # noqa: E501
+ """update_detector # noqa: E501
+
+ Update a detector # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.update_detector(id, patched_detector_request, async_req=True)
+ >>> result = thread.get()
+
+ :param id: (required)
+ :type id: str
+ :param patched_detector_request:
+ :type patched_detector_request: PatchedDetectorRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: Detector
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- return self.list_detectors_endpoint.call_with_http_info(**kwargs)
-
- def update_detector(self, id, **kwargs):
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the update_detector_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.update_detector_with_http_info(id, patched_detector_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def update_detector_with_http_info(
+ self, id: StrictStr, patched_detector_request: Optional[PatchedDetectorRequest] = None, **kwargs
+ ) -> ApiResponse: # noqa: E501
"""update_detector # noqa: E501
Update a detector # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.update_detector(id, async_req=True)
+ >>> thread = api.update_detector_with_http_info(id, patched_detector_request, async_req=True)
>>> result = thread.get()
- Args:
- id (str):
-
- Keyword Args:
- patched_detector_request (PatchedDetectorRequest): [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- Detector
- If the method is called asynchronously, returns the request
- thread.
+ :param id: (required)
+ :type id: str
+ :param patched_detector_request:
+ :type patched_detector_request: PatchedDetectorRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(Detector, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.update_detector_endpoint.call_with_http_info(**kwargs)
+
+ _params = locals()
+
+ _all_params = ["id", "patched_detector_request"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method update_detector" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["patched_detector_request"] is not None:
+ _body_params = _params["patched_detector_request"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
+ ),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "Detector",
+ }
+
+ return self.api_client.call_api(
+ "/v1/detectors/{id}",
+ "PATCH",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/edge_api.py b/generated/groundlight_openapi_client/api/edge_api.py
index a0b3187d..ef448034 100644
--- a/generated/groundlight_openapi_client/api/edge_api.py
+++ b/generated/groundlight_openapi_client/api/edge_api.py
@@ -1,106 +1,47 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.edge_model_info import EdgeModelInfo
-
-
-class EdgeApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from pydantic import StrictStr
+
+from groundlight_openapi_client.models.edge_model_info import EdgeModelInfo
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class EdgeApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.edge_report_metrics_create_endpoint = _Endpoint(
- settings={
- "response_type": None,
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/edge/report-metrics",
- "operation_id": "edge_report_metrics_create",
- "http_method": "POST",
- "servers": None,
- },
- params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {},
- "attribute_map": {},
- "location_map": {},
- "collection_format_map": {},
- },
- headers_map={
- "accept": [],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.get_model_urls_endpoint = _Endpoint(
- settings={
- "response_type": (EdgeModelInfo,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/edge/fetch-model-urls/{detector_id}/",
- "operation_id": "get_model_urls",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- ],
- "required": [
- "detector_id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- },
- "location_map": {
- "detector_id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- def edge_report_metrics_create(self, **kwargs):
+ @validate_arguments
+ def edge_report_metrics_create(self, **kwargs) -> None: # noqa: E501
"""edge_report_metrics_create # noqa: E501
Edge server periodically calls this to report metrics. POST body will have JSON data that we log. # noqa: E501
@@ -110,52 +51,121 @@ def edge_report_metrics_create(self, **kwargs):
>>> thread = api.edge_report_metrics_create(async_req=True)
>>> result = thread.get()
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the edge_report_metrics_create_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.edge_report_metrics_create_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def edge_report_metrics_create_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
+ """edge_report_metrics_create # noqa: E501
+
+ Edge server periodically calls this to report metrics. POST body will have JSON data that we log. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
+ >>> thread = api.edge_report_metrics_create_with_http_info(async_req=True)
+ >>> result = thread.get()
+
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- return self.edge_report_metrics_create_endpoint.call_with_http_info(**kwargs)
-
- def get_model_urls(self, detector_id, **kwargs):
+
+ _params = locals()
+
+ _all_params = []
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError(
+ "Got an unexpected keyword argument '%s' to method edge_report_metrics_create" % _key
+ )
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/v1/edge/report-metrics",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_model_urls(self, detector_id: StrictStr, **kwargs) -> EdgeModelInfo: # noqa: E501
"""get_model_urls # noqa: E501
Gets time limited pre-authenticated URLs to download a detector's edge model and oodd model. # noqa: E501
@@ -165,50 +175,124 @@ def get_model_urls(self, detector_id, **kwargs):
>>> thread = api.get_model_urls(detector_id, async_req=True)
>>> result = thread.get()
- Args:
- detector_id (str):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- EdgeModelInfo
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: (required)
+ :type detector_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: EdgeModelInfo
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_model_urls_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_model_urls_with_http_info(detector_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_model_urls_with_http_info(self, detector_id: StrictStr, **kwargs) -> ApiResponse: # noqa: E501
+ """get_model_urls # noqa: E501
+
+ Gets time limited pre-authenticated URLs to download a detector's edge model and oodd model. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_model_urls_with_http_info(detector_id, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_id: (required)
+ :type detector_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(EdgeModelInfo, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_id"] = detector_id
- return self.get_model_urls_endpoint.call_with_http_info(**kwargs)
+
+ _params = locals()
+
+ _all_params = ["detector_id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_model_urls" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["detector_id"] is not None:
+ _path_params["detector_id"] = _params["detector_id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "EdgeModelInfo",
+ }
+
+ return self.api_client.call_api(
+ "/v1/edge/fetch-model-urls/{detector_id}/",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/image_queries_api.py b/generated/groundlight_openapi_client/api/image_queries_api.py
index 03ad2600..4e05ae1b 100644
--- a/generated/groundlight_openapi_client/api/image_queries_api.py
+++ b/generated/groundlight_openapi_client/api/image_queries_api.py
@@ -1,255 +1,55 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.image_query import ImageQuery
-from groundlight_openapi_client.model.paginated_image_query_list import PaginatedImageQueryList
-
-
-class ImageQueriesApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from typing_extensions import Annotated
+from pydantic import Field, StrictBytes, StrictFloat, StrictInt, StrictStr, confloat, conint
+
+from typing import Optional, Union
+
+from groundlight_openapi_client.models.image_query import ImageQuery
+from groundlight_openapi_client.models.paginated_image_query_list import PaginatedImageQueryList
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class ImageQueriesApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.get_image_endpoint = _Endpoint(
- settings={
- "response_type": (file_type,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/image-queries/{id}/image",
- "operation_id": "get_image",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (str,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["image/jpeg"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.get_image_query_endpoint = _Endpoint(
- settings={
- "response_type": (ImageQuery,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/image-queries/{id}",
- "operation_id": "get_image_query",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "id",
- ],
- "required": [
- "id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "id": (str,),
- },
- "attribute_map": {
- "id": "id",
- },
- "location_map": {
- "id": "path",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.list_image_queries_endpoint = _Endpoint(
- settings={
- "response_type": (PaginatedImageQueryList,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/image-queries",
- "operation_id": "list_image_queries",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- "page",
- "page_size",
- ],
- "required": [],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- "page": (int,),
- "page_size": (int,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- "page": "page",
- "page_size": "page_size",
- },
- "location_map": {
- "detector_id": "query",
- "page": "query",
- "page_size": "query",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- self.submit_image_query_endpoint = _Endpoint(
- settings={
- "response_type": (ImageQuery,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/image-queries",
- "operation_id": "submit_image_query",
- "http_method": "POST",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- "confidence_threshold",
- "human_review",
- "image_query_id",
- "inspection_id",
- "metadata",
- "patience_time",
- "want_async",
- "body",
- ],
- "required": [
- "detector_id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [
- "confidence_threshold",
- ],
- },
- root_map={
- "validations": {
- ("confidence_threshold",): {
- "inclusive_maximum": 1,
- "inclusive_minimum": 0,
- },
- },
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- "confidence_threshold": (float,),
- "human_review": (str,),
- "image_query_id": (str,),
- "inspection_id": (str,),
- "metadata": (str,),
- "patience_time": (float,),
- "want_async": (str,),
- "body": (file_type,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- "confidence_threshold": "confidence_threshold",
- "human_review": "human_review",
- "image_query_id": "image_query_id",
- "inspection_id": "inspection_id",
- "metadata": "metadata",
- "patience_time": "patience_time",
- "want_async": "want_async",
- },
- "location_map": {
- "detector_id": "query",
- "confidence_threshold": "query",
- "human_review": "query",
- "image_query_id": "query",
- "inspection_id": "query",
- "metadata": "query",
- "patience_time": "query",
- "want_async": "query",
- "body": "body",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [
- "image/jpeg",
- "image/jpg",
- "image/png",
- "image/gif",
- "image/webp",
- "image/bmp",
- "image/x-icon",
- ],
- },
- api_client=api_client,
- )
- def get_image(self, id, **kwargs):
+ @validate_arguments
+ def get_image(
+ self,
+ id: Annotated[StrictStr, Field(..., description="Retrieve the image associated with the image query ID.")],
+ **kwargs,
+ ) -> bytearray: # noqa: E501
"""get_image # noqa: E501
Retrieve an image by its ID. # noqa: E501
@@ -259,55 +59,136 @@ def get_image(self, id, **kwargs):
>>> thread = api.get_image(id, async_req=True)
>>> result = thread.get()
- Args:
- id (str): Retrieve the image associated with the image query ID.
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- file_type
- If the method is called asynchronously, returns the request
- thread.
+ :param id: Retrieve the image associated with the image query ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: bytearray
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.get_image_endpoint.call_with_http_info(**kwargs)
-
- def get_image_query(self, id, **kwargs):
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_image_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_image_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_image_with_http_info(
+ self,
+ id: Annotated[StrictStr, Field(..., description="Retrieve the image associated with the image query ID.")],
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
+ """get_image # noqa: E501
+
+ Retrieve an image by its ID. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_image_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: Retrieve the image associated with the image query ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(bytearray, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_image" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["image/jpeg"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "bytearray",
+ }
+
+ return self.api_client.call_api(
+ "/v1/image-queries/{id}/image",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_image_query(
+ self, id: Annotated[StrictStr, Field(..., description="Choose an image query by its ID.")], **kwargs
+ ) -> ImageQuery: # noqa: E501
"""get_image_query # noqa: E501
Retrieve an image-query by its ID. # noqa: E501
@@ -317,174 +198,612 @@ def get_image_query(self, id, **kwargs):
>>> thread = api.get_image_query(id, async_req=True)
>>> result = thread.get()
- Args:
- id (str): Choose an image query by its ID.
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ImageQuery
- If the method is called asynchronously, returns the request
- thread.
+ :param id: Choose an image query by its ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ImageQuery
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["id"] = id
- return self.get_image_query_endpoint.call_with_http_info(**kwargs)
-
- def list_image_queries(self, **kwargs):
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_image_query_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_image_query_with_http_info(id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_image_query_with_http_info(
+ self, id: Annotated[StrictStr, Field(..., description="Choose an image query by its ID.")], **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """get_image_query # noqa: E501
+
+ Retrieve an image-query by its ID. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_image_query_with_http_info(id, async_req=True)
+ >>> result = thread.get()
+
+ :param id: Choose an image query by its ID. (required)
+ :type id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ImageQuery, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_image_query" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+ if _params["id"] is not None:
+ _path_params["id"] = _params["id"]
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "ImageQuery",
+ }
+
+ return self.api_client.call_api(
+ "/v1/image-queries/{id}",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def list_image_queries(
+ self,
+ detector_id: Annotated[
+ Optional[StrictStr], Field(description="Optionally filter image queries by detector ID.")
+ ] = None,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of items to return per page.")] = None,
+ **kwargs,
+ ) -> PaginatedImageQueryList: # noqa: E501
"""list_image_queries # noqa: E501
Retrieve a list of image-queries. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.list_image_queries(async_req=True)
+ >>> thread = api.list_image_queries(detector_id, page, page_size, async_req=True)
>>> result = thread.get()
+ :param detector_id: Optionally filter image queries by detector ID.
+ :type detector_id: str
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of items to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: PaginatedImageQueryList
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the list_image_queries_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.list_image_queries_with_http_info(detector_id, page, page_size, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def list_image_queries_with_http_info(
+ self,
+ detector_id: Annotated[
+ Optional[StrictStr], Field(description="Optionally filter image queries by detector ID.")
+ ] = None,
+ page: Annotated[
+ Optional[StrictInt], Field(description="A page number within the paginated result set.")
+ ] = None,
+ page_size: Annotated[Optional[StrictInt], Field(description="Number of items to return per page.")] = None,
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
+ """list_image_queries # noqa: E501
+
+ Retrieve a list of image-queries. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.list_image_queries_with_http_info(detector_id, page, page_size, async_req=True)
+ >>> result = thread.get()
- Keyword Args:
- detector_id (str): Optionally filter image queries by detector ID.. [optional]
- page (int): A page number within the paginated result set.. [optional]
- page_size (int): Number of items to return per page.. [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- PaginatedImageQueryList
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: Optionally filter image queries by detector ID.
+ :type detector_id: str
+ :param page: A page number within the paginated result set.
+ :type page: int
+ :param page_size: Number of items to return per page.
+ :type page_size: int
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(PaginatedImageQueryList, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- return self.list_image_queries_endpoint.call_with_http_info(**kwargs)
-
- def submit_image_query(self, detector_id, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["detector_id", "page", "page_size"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method list_image_queries" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("detector_id") is not None: # noqa: E501
+ _query_params.append(("detector_id", _params["detector_id"]))
+
+ if _params.get("page") is not None: # noqa: E501
+ _query_params.append(("page", _params["page"]))
+
+ if _params.get("page_size") is not None: # noqa: E501
+ _query_params.append(("page_size", _params["page_size"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "PaginatedImageQueryList",
+ }
+
+ return self.api_client.call_api(
+ "/v1/image-queries",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def submit_image_query(
+ self,
+ detector_id: Annotated[StrictStr, Field(..., description="Choose a detector by its ID.")],
+ confidence_threshold: Annotated[
+ Optional[Union[confloat(le=1, ge=0, strict=True), conint(le=1.0, ge=0.0, strict=True)]],
+ Field(description="The confidence threshold for the image query."),
+ ] = None,
+ human_review: Annotated[
+ Optional[StrictStr],
+ Field(
+ description=(
+ "If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review"
+ " if the ML model is not confident). If set to `ALWAYS`, always send the image query for human"
+ " review even if the ML model is confident. If set to `NEVER`, never send the image query for human"
+ " review even if the ML model is not confident."
+ )
+ ),
+ ] = None,
+ image_query_id: Annotated[
+ Optional[StrictStr], Field(description="The ID to assign to the created image query.")
+ ] = None,
+ inspection_id: Annotated[
+ Optional[StrictStr], Field(description="Associate the image query with an inspection.")
+ ] = None,
+ metadata: Annotated[
+ Optional[StrictStr],
+ Field(
+ description=(
+ "A dictionary of custom key/value metadata to associate with the image query (limited to 1KB)."
+ )
+ ),
+ ] = None,
+ patience_time: Annotated[
+ Optional[Union[StrictFloat, StrictInt]], Field(description="How long to wait for a confident response.")
+ ] = None,
+ want_async: Annotated[
+ Optional[StrictStr],
+ Field(
+ description=(
+ 'If "true" then submitting an image query returns immediately without a result. The result will be'
+ " computed asynchronously and can be retrieved later."
+ )
+ ),
+ ] = None,
+ body: Optional[Union[StrictBytes, StrictStr]] = None,
+ **kwargs,
+ ) -> ImageQuery: # noqa: E501
"""submit_image_query # noqa: E501
Submit an image query against a detector. You must use `\"Content-Type: image/jpeg\"` or similar (image/png, image/webp, etc) for the image data. For example: ```Bash $ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \\ --header \"Content-Type: image/jpeg\" \\ --data-binary @path/to/filename.jpeg ``` # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.submit_image_query(detector_id, async_req=True)
+ >>> thread = api.submit_image_query(detector_id, confidence_threshold, human_review, image_query_id, inspection_id, metadata, patience_time, want_async, body, async_req=True)
>>> result = thread.get()
- Args:
- detector_id (str): Choose a detector by its ID.
-
- Keyword Args:
- confidence_threshold (float): The confidence threshold for the image query.. [optional]
- human_review (str): If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident.. [optional]
- image_query_id (str): The ID to assign to the created image query.. [optional]
- inspection_id (str): Associate the image query with an inspection.. [optional]
- metadata (str): A dictionary of custom key/value metadata to associate with the image query (limited to 1KB).. [optional]
- patience_time (float): How long to wait for a confident response.. [optional]
- want_async (str): If \"true\" then submitting an image query returns immediately without a result. The result will be computed asynchronously and can be retrieved later.. [optional]
- body (file_type): [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- ImageQuery
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: Choose a detector by its ID. (required)
+ :type detector_id: str
+ :param confidence_threshold: The confidence threshold for the image query.
+ :type confidence_threshold: float
+ :param human_review: If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident.
+ :type human_review: str
+ :param image_query_id: The ID to assign to the created image query.
+ :type image_query_id: str
+ :param inspection_id: Associate the image query with an inspection.
+ :type inspection_id: str
+ :param metadata: A dictionary of custom key/value metadata to associate with the image query (limited to 1KB).
+ :type metadata: str
+ :param patience_time: How long to wait for a confident response.
+ :type patience_time: float
+ :param want_async: If \"true\" then submitting an image query returns immediately without a result. The result will be computed asynchronously and can be retrieved later.
+ :type want_async: str
+ :param body:
+ :type body: bytearray
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: ImageQuery
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_id"] = detector_id
- return self.submit_image_query_endpoint.call_with_http_info(**kwargs)
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the submit_image_query_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.submit_image_query_with_http_info(
+ detector_id,
+ confidence_threshold,
+ human_review,
+ image_query_id,
+ inspection_id,
+ metadata,
+ patience_time,
+ want_async,
+ body,
+ **kwargs,
+ ) # noqa: E501
+
+ @validate_arguments
+ def submit_image_query_with_http_info(
+ self,
+ detector_id: Annotated[StrictStr, Field(..., description="Choose a detector by its ID.")],
+ confidence_threshold: Annotated[
+ Optional[Union[confloat(le=1, ge=0, strict=True), conint(le=1.0, ge=0.0, strict=True)]],
+ Field(description="The confidence threshold for the image query."),
+ ] = None,
+ human_review: Annotated[
+ Optional[StrictStr],
+ Field(
+ description=(
+ "If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review"
+ " if the ML model is not confident). If set to `ALWAYS`, always send the image query for human"
+ " review even if the ML model is confident. If set to `NEVER`, never send the image query for human"
+ " review even if the ML model is not confident."
+ )
+ ),
+ ] = None,
+ image_query_id: Annotated[
+ Optional[StrictStr], Field(description="The ID to assign to the created image query.")
+ ] = None,
+ inspection_id: Annotated[
+ Optional[StrictStr], Field(description="Associate the image query with an inspection.")
+ ] = None,
+ metadata: Annotated[
+ Optional[StrictStr],
+ Field(
+ description=(
+ "A dictionary of custom key/value metadata to associate with the image query (limited to 1KB)."
+ )
+ ),
+ ] = None,
+ patience_time: Annotated[
+ Optional[Union[StrictFloat, StrictInt]], Field(description="How long to wait for a confident response.")
+ ] = None,
+ want_async: Annotated[
+ Optional[StrictStr],
+ Field(
+ description=(
+ 'If "true" then submitting an image query returns immediately without a result. The result will be'
+ " computed asynchronously and can be retrieved later."
+ )
+ ),
+ ] = None,
+ body: Optional[Union[StrictBytes, StrictStr]] = None,
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
+ """submit_image_query # noqa: E501
+
+ Submit an image query against a detector. You must use `\"Content-Type: image/jpeg\"` or similar (image/png, image/webp, etc) for the image data. For example: ```Bash $ curl https://api.groundlight.ai/device-api/v1/image-queries?detector_id=det_abc123 \\ --header \"Content-Type: image/jpeg\" \\ --data-binary @path/to/filename.jpeg ``` # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.submit_image_query_with_http_info(detector_id, confidence_threshold, human_review, image_query_id, inspection_id, metadata, patience_time, want_async, body, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_id: Choose a detector by its ID. (required)
+ :type detector_id: str
+ :param confidence_threshold: The confidence threshold for the image query.
+ :type confidence_threshold: float
+ :param human_review: If set to `DEFAULT`, use the regular escalation logic (i.e., send the image query for human review if the ML model is not confident). If set to `ALWAYS`, always send the image query for human review even if the ML model is confident. If set to `NEVER`, never send the image query for human review even if the ML model is not confident.
+ :type human_review: str
+ :param image_query_id: The ID to assign to the created image query.
+ :type image_query_id: str
+ :param inspection_id: Associate the image query with an inspection.
+ :type inspection_id: str
+ :param metadata: A dictionary of custom key/value metadata to associate with the image query (limited to 1KB).
+ :type metadata: str
+ :param patience_time: How long to wait for a confident response.
+ :type patience_time: float
+ :param want_async: If \"true\" then submitting an image query returns immediately without a result. The result will be computed asynchronously and can be retrieved later.
+ :type want_async: str
+ :param body:
+ :type body: bytearray
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(ImageQuery, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = [
+ "detector_id",
+ "confidence_threshold",
+ "human_review",
+ "image_query_id",
+ "inspection_id",
+ "metadata",
+ "patience_time",
+ "want_async",
+ "body",
+ ]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method submit_image_query" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("confidence_threshold") is not None: # noqa: E501
+ _query_params.append(("confidence_threshold", _params["confidence_threshold"]))
+
+ if _params.get("detector_id") is not None: # noqa: E501
+ _query_params.append(("detector_id", _params["detector_id"]))
+
+ if _params.get("human_review") is not None: # noqa: E501
+ _query_params.append(("human_review", _params["human_review"]))
+
+ if _params.get("image_query_id") is not None: # noqa: E501
+ _query_params.append(("image_query_id", _params["image_query_id"]))
+
+ if _params.get("inspection_id") is not None: # noqa: E501
+ _query_params.append(("inspection_id", _params["inspection_id"]))
+
+ if _params.get("metadata") is not None: # noqa: E501
+ _query_params.append(("metadata", _params["metadata"]))
+
+ if _params.get("patience_time") is not None: # noqa: E501
+ _query_params.append(("patience_time", _params["patience_time"]))
+
+ if _params.get("want_async") is not None: # noqa: E501
+ _query_params.append(("want_async", _params["want_async"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["body"] is not None:
+ _body_params = _params["body"]
+ # convert to byte array if the input is a file name (str)
+ if isinstance(_body_params, str):
+ with io.open(_body_params, "rb") as _fp:
+ _body_params_from_file = _fp.read()
+ _body_params = _body_params_from_file
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(
+ ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/webp", "image/bmp", "image/x-icon"]
+ ),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "201": "ImageQuery",
+ }
+
+ return self.api_client.call_api(
+ "/v1/image-queries",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/labels_api.py b/generated/groundlight_openapi_client/api/labels_api.py
index fd948a9f..d70a9b54 100644
--- a/generated/groundlight_openapi_client/api/labels_api.py
+++ b/generated/groundlight_openapi_client/api/labels_api.py
@@ -1,81 +1,46 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.label_value import LabelValue
-from groundlight_openapi_client.model.label_value_request import LabelValueRequest
-
-
-class LabelsApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from groundlight_openapi_client.models.label_value import LabelValue
+from groundlight_openapi_client.models.label_value_request import LabelValueRequest
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class LabelsApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.create_label_endpoint = _Endpoint(
- settings={
- "response_type": (LabelValue,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/labels",
- "operation_id": "create_label",
- "http_method": "POST",
- "servers": None,
- },
- params_map={
- "all": [
- "label_value_request",
- ],
- "required": [
- "label_value_request",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "label_value_request": (LabelValueRequest,),
- },
- "attribute_map": {},
- "location_map": {
- "label_value_request": "body",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"],
- },
- api_client=api_client,
- )
- def create_label(self, label_value_request, **kwargs):
+ @validate_arguments
+ def create_label(self, label_value_request: LabelValueRequest, **kwargs) -> LabelValue: # noqa: E501
"""create_label # noqa: E501
Create a new LabelValue and attach it to an image query. This will trigger asynchronous fine-tuner model training. # noqa: E501
@@ -85,50 +50,137 @@ def create_label(self, label_value_request, **kwargs):
>>> thread = api.create_label(label_value_request, async_req=True)
>>> result = thread.get()
- Args:
- label_value_request (LabelValueRequest):
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- LabelValue
- If the method is called asynchronously, returns the request
- thread.
+ :param label_value_request: (required)
+ :type label_value_request: LabelValueRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: LabelValue
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the create_label_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.create_label_with_http_info(label_value_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_label_with_http_info(
+ self, label_value_request: LabelValueRequest, **kwargs
+ ) -> ApiResponse: # noqa: E501
+ """create_label # noqa: E501
+
+ Create a new LabelValue and attach it to an image query. This will trigger asynchronous fine-tuner model training. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_label_with_http_info(label_value_request, async_req=True)
+ >>> result = thread.get()
+
+ :param label_value_request: (required)
+ :type label_value_request: LabelValueRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(LabelValue, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["label_value_request"] = label_value_request
- return self.create_label_endpoint.call_with_http_info(**kwargs)
+
+ _params = locals()
+
+ _all_params = ["label_value_request"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method create_label" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["label_value_request"] is not None:
+ _body_params = _params["label_value_request"]
+
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
+ ),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "201": "LabelValue",
+ }
+
+ return self.api_client.call_api(
+ "/v1/labels",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/notes_api.py b/generated/groundlight_openapi_client/api/notes_api.py
index f1af2cb5..bfdd8bcd 100644
--- a/generated/groundlight_openapi_client/api/notes_api.py
+++ b/generated/groundlight_openapi_client/api/notes_api.py
@@ -1,185 +1,211 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.all_notes import AllNotes
-from groundlight_openapi_client.model.note_request import NoteRequest
-
-
-class NotesApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from typing_extensions import Annotated
+from pydantic import Field, StrictStr
+
+from typing import Optional
+
+from groundlight_openapi_client.models.all_notes import AllNotes
+from groundlight_openapi_client.models.note_request import NoteRequest
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class NotesApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.create_note_endpoint = _Endpoint(
- settings={
- "response_type": None,
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/notes",
- "operation_id": "create_note",
- "http_method": "POST",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- "note_request",
- ],
- "required": [
- "detector_id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- "note_request": (NoteRequest,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- },
- "location_map": {
- "detector_id": "query",
- "note_request": "body",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": [],
- "content_type": ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"],
- },
- api_client=api_client,
- )
- self.get_notes_endpoint = _Endpoint(
- settings={
- "response_type": (AllNotes,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/notes",
- "operation_id": "get_notes",
- "http_method": "GET",
- "servers": None,
- },
- params_map={
- "all": [
- "detector_id",
- ],
- "required": [
- "detector_id",
- ],
- "nullable": [],
- "enum": [],
- "validation": [],
- },
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {
- "detector_id": (str,),
- },
- "attribute_map": {
- "detector_id": "detector_id",
- },
- "location_map": {
- "detector_id": "query",
- },
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- def create_note(self, detector_id, **kwargs):
+ @validate_arguments
+ def create_note(
+ self,
+ detector_id: Annotated[StrictStr, Field(..., description="the detector to associate the new note with")],
+ note_request: Optional[NoteRequest] = None,
+ **kwargs,
+ ) -> None: # noqa: E501
+ """create_note # noqa: E501
+
+ Creates a new note. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.create_note(detector_id, note_request, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_id: the detector to associate the new note with (required)
+ :type detector_id: str
+ :param note_request:
+ :type note_request: NoteRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the create_note_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.create_note_with_http_info(detector_id, note_request, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def create_note_with_http_info(
+ self,
+ detector_id: Annotated[StrictStr, Field(..., description="the detector to associate the new note with")],
+ note_request: Optional[NoteRequest] = None,
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
"""create_note # noqa: E501
Creates a new note. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
- >>> thread = api.create_note(detector_id, async_req=True)
+ >>> thread = api.create_note_with_http_info(detector_id, note_request, async_req=True)
>>> result = thread.get()
- Args:
- detector_id (str): the detector to associate the new note with
-
- Keyword Args:
- note_request (NoteRequest): [optional]
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- None
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: the detector to associate the new note with (required)
+ :type detector_id: str
+ :param note_request:
+ :type note_request: NoteRequest
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: None
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_id"] = detector_id
- return self.create_note_endpoint.call_with_http_info(**kwargs)
-
- def get_notes(self, detector_id, **kwargs):
+
+ _params = locals()
+
+ _all_params = ["detector_id", "note_request"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method create_note" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("detector_id") is not None: # noqa: E501
+ _query_params.append(("detector_id", _params["detector_id"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ if _params["note_request"] is not None:
+ _body_params = _params["note_request"]
+
+ # set the HTTP header `Content-Type`
+ _content_types_list = _params.get(
+ "_content_type",
+ self.api_client.select_header_content_type(
+ ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"]
+ ),
+ )
+ if _content_types_list:
+ _header_params["Content-Type"] = _content_types_list
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {}
+
+ return self.api_client.call_api(
+ "/v1/notes",
+ "POST",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
+
+ @validate_arguments
+ def get_notes(
+ self,
+ detector_id: Annotated[StrictStr, Field(..., description="the detector whose notes to retrieve")],
+ **kwargs,
+ ) -> AllNotes: # noqa: E501
"""get_notes # noqa: E501
Retrieves all notes from a given detector and returns them in lists, one for each note_category. # noqa: E501
@@ -189,50 +215,129 @@ def get_notes(self, detector_id, **kwargs):
>>> thread = api.get_notes(detector_id, async_req=True)
>>> result = thread.get()
- Args:
- detector_id (str): the detector whose notes to retrieve
-
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- AllNotes
- If the method is called asynchronously, returns the request
- thread.
+ :param detector_id: the detector whose notes to retrieve (required)
+ :type detector_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: AllNotes
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- kwargs["detector_id"] = detector_id
- return self.get_notes_endpoint.call_with_http_info(**kwargs)
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the get_notes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.get_notes_with_http_info(detector_id, **kwargs) # noqa: E501
+
+ @validate_arguments
+ def get_notes_with_http_info(
+ self,
+ detector_id: Annotated[StrictStr, Field(..., description="the detector whose notes to retrieve")],
+ **kwargs,
+ ) -> ApiResponse: # noqa: E501
+ """get_notes # noqa: E501
+
+ Retrieves all notes from a given detector and returns them in lists, one for each note_category. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.get_notes_with_http_info(detector_id, async_req=True)
+ >>> result = thread.get()
+
+ :param detector_id: the detector whose notes to retrieve (required)
+ :type detector_id: str
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(AllNotes, status_code(int), headers(HTTPHeaderDict))
+ """
+
+ _params = locals()
+
+ _all_params = ["detector_id"]
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method get_notes" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ if _params.get("detector_id") is not None: # noqa: E501
+ _query_params.append(("detector_id", _params["detector_id"]))
+
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "AllNotes",
+ }
+
+ return self.api_client.call_api(
+ "/v1/notes",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api/user_api.py b/generated/groundlight_openapi_client/api/user_api.py
index a14200f2..95a589cd 100644
--- a/generated/groundlight_openapi_client/api/user_api.py
+++ b/generated/groundlight_openapi_client/api/user_api.py
@@ -1,66 +1,45 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.api_client import ApiClient, Endpoint as _Endpoint
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- check_allowed_values,
- check_validations,
- date,
- datetime,
- file_type,
- none_type,
- validate_and_convert_types,
-)
-from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002
-
-
-class UserApi(object):
+import io
+import warnings
+
+from pydantic import validate_arguments, ValidationError
+
+from groundlight_openapi_client.models.who_am_i200_response import WhoAmI200Response
+
+from groundlight_openapi_client.api_client import ApiClient
+from groundlight_openapi_client.api_response import ApiResponse
+from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError # noqa: F401
+
+
+class UserApi:
"""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):
+ def __init__(self, api_client=None) -> None:
if api_client is None:
- api_client = ApiClient()
+ api_client = ApiClient.get_default()
self.api_client = api_client
- self.who_am_i_endpoint = _Endpoint(
- settings={
- "response_type": (InlineResponse2002,),
- "auth": ["ApiToken"],
- "endpoint_path": "/v1/me",
- "operation_id": "who_am_i",
- "http_method": "GET",
- "servers": None,
- },
- params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
- root_map={
- "validations": {},
- "allowed_values": {},
- "openapi_types": {},
- "attribute_map": {},
- "location_map": {},
- "collection_format_map": {},
- },
- headers_map={
- "accept": ["application/json"],
- "content_type": [],
- },
- api_client=api_client,
- )
- def who_am_i(self, **kwargs):
+ @validate_arguments
+ def who_am_i(self, **kwargs) -> WhoAmI200Response: # noqa: E501
"""who_am_i # noqa: E501
Retrieve the current user. # noqa: E501
@@ -70,47 +49,118 @@ def who_am_i(self, **kwargs):
>>> thread = api.who_am_i(async_req=True)
>>> result = thread.get()
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :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.
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: WhoAmI200Response
+ """
+ kwargs["_return_http_data_only"] = True
+ if "_preload_content" in kwargs:
+ message = "Error! Please call the who_am_i_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
+ raise ValueError(message)
+ return self.who_am_i_with_http_info(**kwargs) # noqa: E501
+
+ @validate_arguments
+ def who_am_i_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501
+ """who_am_i # noqa: E501
+
+ Retrieve the current user. # noqa: E501
+ This method makes a synchronous HTTP request by default. To make an
+ asynchronous HTTP request, please pass async_req=True
+
+ >>> thread = api.who_am_i_with_http_info(async_req=True)
+ >>> result = thread.get()
- Keyword Args:
- _return_http_data_only (bool): response data without head status
- code and headers. Default is True.
- _preload_content (bool): if False, the urllib3.HTTPResponse object
- will be returned without reading/decoding response data.
- Default is True.
- _request_timeout (int/float/tuple): 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.
- Default is None.
- _check_input_type (bool): specifies if type checking
- should be done one the data sent to the server.
- Default is True.
- _check_return_type (bool): specifies if type checking
- should be done one the data received from the server.
- Default is True.
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _content_type (str/None): force body content-type.
- Default is None and content-type will be predicted by allowed
- content-types and body.
- _host_index (int/None): specifies the index of the server
- that we want to use.
- Default is read from the configuration.
- async_req (bool): execute request asynchronously
-
- Returns:
- InlineResponse2002
- If the method is called asynchronously, returns the request
- thread.
+ :param async_req: Whether to execute the request asynchronously.
+ :type async_req: bool, optional
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
+ :type _preload_content: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :type _return_http_data_only: bool, optional
+ :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 _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_auth: dict, optional
+ :type _content_type: string, optional: force content-type for the request
+ :return: Returns the result object.
+ If the method is called asynchronously,
+ returns the request thread.
+ :rtype: tuple(WhoAmI200Response, status_code(int), headers(HTTPHeaderDict))
"""
- kwargs["async_req"] = kwargs.get("async_req", False)
- kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
- kwargs["_preload_content"] = kwargs.get("_preload_content", True)
- kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
- kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
- kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
- kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
- kwargs["_content_type"] = kwargs.get("_content_type")
- kwargs["_host_index"] = kwargs.get("_host_index")
- return self.who_am_i_endpoint.call_with_http_info(**kwargs)
+
+ _params = locals()
+
+ _all_params = []
+ _all_params.extend([
+ "async_req",
+ "_return_http_data_only",
+ "_preload_content",
+ "_request_timeout",
+ "_request_auth",
+ "_content_type",
+ "_headers",
+ ])
+
+ # validate the arguments
+ for _key, _val in _params["kwargs"].items():
+ if _key not in _all_params:
+ raise ApiTypeError("Got an unexpected keyword argument '%s' to method who_am_i" % _key)
+ _params[_key] = _val
+ del _params["kwargs"]
+
+ _collection_formats = {}
+
+ # process the path parameters
+ _path_params = {}
+
+ # process the query parameters
+ _query_params = []
+ # process the header parameters
+ _header_params = dict(_params.get("_headers", {}))
+ # process the form parameters
+ _form_params = []
+ _files = {}
+ # process the body parameter
+ _body_params = None
+ # set the HTTP header `Accept`
+ _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) # noqa: E501
+
+ # authentication setting
+ _auth_settings = ["ApiToken"] # noqa: E501
+
+ _response_types_map = {
+ "200": "WhoAmI200Response",
+ }
+
+ return self.api_client.call_api(
+ "/v1/me",
+ "GET",
+ _path_params,
+ _query_params,
+ _header_params,
+ body=_body_params,
+ post_params=_form_params,
+ files=_files,
+ response_types_map=_response_types_map,
+ auth_settings=_auth_settings,
+ async_req=_params.get("async_req"),
+ _return_http_data_only=_params.get("_return_http_data_only"), # noqa: E501
+ _preload_content=_params.get("_preload_content", True),
+ _request_timeout=_params.get("_request_timeout"),
+ collection_formats=_collection_formats,
+ _request_auth=_params.get("_request_auth"),
+ )
diff --git a/generated/groundlight_openapi_client/api_client.py b/generated/groundlight_openapi_client/api_client.py
index da2e348a..db3bf61f 100644
--- a/generated/groundlight_openapi_client/api_client.py
+++ b/generated/groundlight_openapi_client/api_client.py
@@ -1,45 +1,39 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
-import json
import atexit
+import datetime
+from dateutil.parser import parse
+import json
import mimetypes
from multiprocessing.pool import ThreadPool
-import io
import os
import re
-import typing
-from urllib.parse import quote
-from urllib3.fields import RequestField
+import tempfile
+from urllib.parse import quote
+from pydantic import SecretStr
-from groundlight_openapi_client import rest
from groundlight_openapi_client.configuration import Configuration
-from groundlight_openapi_client.exceptions import ApiTypeError, ApiValueError, ApiException
-from groundlight_openapi_client.model_utils import (
- ModelNormal,
- ModelSimple,
- ModelComposed,
- check_allowed_values,
- check_validations,
- date,
- datetime,
- deserialize_file,
- file_type,
- model_to_dict,
- none_type,
- validate_and_convert_types,
-)
-
-
-class ApiClient(object):
+from groundlight_openapi_client.api_response import ApiResponse
+import groundlight_openapi_client.models
+from groundlight_openapi_client import rest
+from groundlight_openapi_client.exceptions import ApiValueError, ApiException
+
+
+class ApiClient:
"""Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client-
@@ -47,10 +41,6 @@ class ApiClient(object):
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
@@ -61,11 +51,23 @@ class ApiClient(object):
to the API. More threads means more concurrent API requests.
"""
+ PRIMITIVE_TYPES = (float, bool, bytes, str, int)
+ NATIVE_TYPES_MAPPING = {
+ "int": int,
+ "long": int, # TODO remove as only py3 is supported?
+ "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=1):
+ def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1) -> None:
+ # use default configuration if none is provided
if configuration is None:
- configuration = Configuration.get_default_copy()
+ configuration = Configuration.get_default()
self.configuration = configuration
self.pool_threads = pool_threads
@@ -76,6 +78,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook
self.cookie = cookie
# Set default User-Agent.
self.user_agent = "OpenAPI-Generator/1.0.0/python"
+ self.client_side_validation = configuration.client_side_validation
def __enter__(self):
return self
@@ -113,25 +116,50 @@ def user_agent(self, value):
def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
+ _default = None
+
+ @classmethod
+ def get_default(cls):
+ """Return new instance of ApiClient.
+
+ This method returns newly created, based on default constructor,
+ object of ApiClient class or returns a copy of default
+ ApiClient.
+
+ :return: The ApiClient object.
+ """
+ if cls._default is None:
+ cls._default = ApiClient()
+ return cls._default
+
+ @classmethod
+ def set_default(cls, default):
+ """Set default instance of ApiClient.
+
+ It stores default ApiClient.
+
+ :param default: object of ApiClient.
+ """
+ cls._default = default
+
def __call_api(
self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None,
- _content_type: typing.Optional[str] = None,
+ resource_path,
+ method,
+ path_params=None,
+ query_params=None,
+ header_params=None,
+ body=None,
+ post_params=None,
+ files=None,
+ response_types_map=None,
+ auth_settings=None,
+ _return_http_data_only=None,
+ collection_formats=None,
+ _preload_content=True,
+ _request_timeout=None,
+ _host=None,
+ _request_auth=None,
):
config = self.configuration
@@ -153,27 +181,22 @@ def __call_api(
# 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 = post_params if post_params else []
post_params = self.sanitize_for_serialization(post_params)
post_params = self.parameters_to_tuples(post_params, collection_formats)
post_params.extend(self.files_parameters(files))
- if header_params["Content-Type"].startswith("multipart"):
- post_params = self.parameters_to_multipart(post_params, (dict))
+
+ # auth setting
+ self.update_params_for_auth(
+ header_params, query_params, auth_settings, resource_path, method, body, request_auth=_request_auth
+ )
# body
if body:
body = self.sanitize_for_serialization(body)
- # auth setting
- self.update_params_for_auth(header_params, query_params, auth_settings, resource_path, method, body)
-
# request url
if _host is None:
url = self.configuration.host + resource_path
@@ -181,6 +204,12 @@ def __call_api(
# use server/host defined in path or operation instead
url = _host + resource_path
+ # query parameters
+ if query_params:
+ query_params = self.sanitize_for_serialization(query_params)
+ url_query = self.parameters_to_url_query(query_params, collection_formats)
+ url += "?" + url_query
+
try:
# perform request and return response
response_data = self.request(
@@ -194,145 +223,169 @@ def __call_api(
_request_timeout=_request_timeout,
)
except ApiException as e:
- e.body = e.body.decode("utf-8")
+ if e.body:
+ e.body = e.body.decode("utf-8")
raise e
self.last_response = response_data
- return_data = response_data
+ return_data = None # assuming deserialization is not needed
+ # data needs deserialization or returns HTTP data (deserialized) only
+ if _preload_content or _return_http_data_only:
+ response_type = response_types_map.get(str(response_data.status), None)
+ if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
+ # if not found, look for '1XX', '2XX', etc.
+ response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
- if not _preload_content:
- return return_data
- return return_data
-
- # deserialize response data
- if response_type:
- if response_type != (file_type,):
- encoding = "utf-8"
+ if response_type == "bytearray":
+ response_data.data = response_data.data
+ else:
+ match = None
content_type = response_data.getheader("content-type")
if content_type is not None:
- match = re.search(r"charset=([a-zA-Z\-\d]+)[\s\;]?", content_type)
- if match:
- encoding = match.group(1)
+ match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
+ encoding = match.group(1) if match else "utf-8"
response_data.data = response_data.data.decode(encoding)
- return_data = self.deserialize(response_data, response_type, _check_type)
- else:
- return_data = None
+ # deserialize response data
+ if response_type == "bytearray":
+ return_data = response_data.data
+ elif 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 parameters_to_multipart(self, params, collection_types):
- """Get parameters as list of tuples, formatting as json if value is collection_types
+ return ApiResponse(
+ status_code=response_data.status,
+ data=return_data,
+ headers=response_data.getheaders(),
+ raw_data=response_data.data,
+ )
- :param params: Parameters as list of two-tuples
- :param dict collection_types: Parameter collection types
- :return: Parameters as list of tuple or urllib3.fields.RequestField
- """
- new_params = []
- if collection_types is None:
- collection_types = dict
- for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
- if isinstance(v, collection_types): # v is instance of collection_type, formatting as application/json
- v = json.dumps(v, ensure_ascii=False).encode("utf-8")
- field = RequestField(k, v)
- field.make_multipart(content_type="application/json; charset=utf-8")
- new_params.append(field)
- else:
- new_params.append((k, v))
- return new_params
+ def sanitize_for_serialization(self, obj):
+ """Builds a JSON POST object.
- @classmethod
- def sanitize_for_serialization(cls, obj):
- """Prepares data for transmission before it is sent with the rest client
If obj is None, return None.
+ If obj is SecretStr, return obj.get_secret_value()
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.
- If obj is io.IOBase, return the bytes
+
:param obj: The data to serialize.
:return: The serialized form of data.
"""
- if isinstance(obj, (ModelNormal, ModelComposed)):
- return {key: cls.sanitize_for_serialization(val) for key, val in model_to_dict(obj, serialize=True).items()}
- elif isinstance(obj, io.IOBase):
- return cls.get_file_data_and_close_file(obj)
- elif isinstance(obj, (str, int, float, none_type, bool)):
+ if obj is None:
+ return None
+ elif isinstance(obj, SecretStr):
+ return obj.get_secret_value()
+ elif isinstance(obj, self.PRIMITIVE_TYPES):
return obj
- elif isinstance(obj, (datetime, date)):
+ 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()
- elif isinstance(obj, ModelSimple):
- return cls.sanitize_for_serialization(obj.value)
- elif isinstance(obj, (list, tuple)):
- return [cls.sanitize_for_serialization(item) for item in obj]
+
if isinstance(obj, dict):
- return {key: cls.sanitize_for_serialization(val) for key, val in obj.items()}
- raise ApiValueError("Unable to prepare type {} for serialization".format(obj.__class__.__name__))
+ 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.
+ if hasattr(obj, "to_dict") and callable(getattr(obj, "to_dict")):
+ obj_dict = obj.to_dict()
+ else:
+ obj_dict = obj.__dict__
- def deserialize(self, response, response_type, _check_type):
+ 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: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param _check_type: boolean, whether to check the types of the data
- received from the server
- :type _check_type: bool
+ :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_type,):
- content_disposition = response.getheader("Content-Disposition")
- return deserialize_file(response.data, self.configuration, content_disposition=content_disposition)
+ if response_type == "file":
+ return self.__deserialize_file(response)
# fetch data from response object
try:
- received_data = json.loads(response.data)
+ data = json.loads(response.data)
except ValueError:
- received_data = response.data
+ data = response.data
- # store our data under the key of 'received_data' so users have some
- # context if they are deserializing a string and the data type is wrong
- deserialized_data = validate_and_convert_types(
- received_data, response_type, ["received_data"], True, _check_type, configuration=self.configuration
- )
- return deserialized_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 isinstance(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(groundlight_openapi_client.models, 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_datetime(data)
+ else:
+ return self.__deserialize_model(data, klass)
def call_api(
self,
- resource_path: str,
- method: str,
- path_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- query_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- header_params: typing.Optional[typing.Dict[str, typing.Any]] = None,
- body: typing.Optional[typing.Any] = None,
- post_params: typing.Optional[typing.List[typing.Tuple[str, typing.Any]]] = None,
- files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None,
- response_type: typing.Optional[typing.Tuple[typing.Any]] = None,
- auth_settings: typing.Optional[typing.List[str]] = None,
- async_req: typing.Optional[bool] = None,
- _return_http_data_only: typing.Optional[bool] = None,
- collection_formats: typing.Optional[typing.Dict[str, str]] = None,
- _preload_content: bool = True,
- _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None,
- _host: typing.Optional[str] = None,
- _check_type: typing.Optional[bool] = None,
+ resource_path,
+ method,
+ path_params=None,
+ query_params=None,
+ header_params=None,
+ body=None,
+ post_params=None,
+ files=None,
+ response_types_map=None,
+ auth_settings=None,
+ async_req=None,
+ _return_http_data_only=None,
+ collection_formats=None,
+ _preload_content=True,
+ _request_timeout=None,
+ _host=None,
+ _request_auth=None,
):
"""Makes the HTTP request (synchronous) and returns deserialized data.
@@ -348,38 +401,26 @@ def call_api(
: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_type: For the response, a tuple containing:
- valid classes
- a list containing valid classes (for list schemas)
- a dict containing a tuple of valid classes as the value
- Example values:
- (str,)
- (Pet,)
- (float, none_type)
- ([int, none_type],)
- ({str: (bool, str, int, float, date, datetime, str, none_type)},)
- :param files: key -> field name, value -> a list of open file
- objects for `multipart/form-data`.
- :type files: dict
+ :param response: Response data type.
+ :param files dict: key -> filename, value -> filepath,
+ for `multipart/form-data`.
:param async_req bool: execute request asynchronously
- :type async_req: bool, optional
- :param _return_http_data_only: response data without head status code
- and headers
- :type _return_http_data_only: bool, optional
+ :param _return_http_data_only: response data instead of ApiResponse
+ object with status code, headers, etc
+ :param _preload_content: if False, the ApiResponse.data will
+ be set to none and raw_data will store the
+ HTTP response body without reading/decoding.
+ Default is True.
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
- :type collection_formats: dict, optional
- :param _preload_content: if False, the urllib3.HTTPResponse object will
- be returned without reading/decoding response
- data. Default is True.
- :type _preload_content: bool, optional
: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 _check_type: boolean describing if the data back from the server
- should have its type checked.
- :type _check_type: bool, optional
+ :param _request_auth: set to override the auth_settings for an a single
+ request; this effectively ignores the authentication
+ in the spec for a single request.
+ :type _request_token: dict, optional
:return:
If async_req parameter is True,
the request will be called asynchronously.
@@ -387,47 +428,28 @@ def call_api(
If parameter async_req is False or missing,
then the method will return the response directly.
"""
+ args = (
+ resource_path,
+ method,
+ path_params,
+ query_params,
+ header_params,
+ body,
+ post_params,
+ files,
+ response_types_map,
+ auth_settings,
+ _return_http_data_only,
+ collection_formats,
+ _preload_content,
+ _request_timeout,
+ _host,
+ _request_auth,
+ )
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,
- _host,
- _check_type,
- )
+ return self.__call_api(*args)
- return 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,
- _host,
- _check_type,
- ),
- )
+ return self.pool.apply_async(self.__call_api, args)
def request(
self,
@@ -442,7 +464,7 @@ def request(
):
"""Makes the HTTP request using RESTClient."""
if method == "GET":
- return self.rest_client.GET(
+ return self.rest_client.get_request(
url,
query_params=query_params,
_preload_content=_preload_content,
@@ -450,7 +472,7 @@ def request(
headers=headers,
)
elif method == "HEAD":
- return self.rest_client.HEAD(
+ return self.rest_client.head_request(
url,
query_params=query_params,
_preload_content=_preload_content,
@@ -458,17 +480,15 @@ def request(
headers=headers,
)
elif method == "OPTIONS":
- return self.rest_client.OPTIONS(
+ return self.rest_client.options_request(
url,
query_params=query_params,
headers=headers,
- post_params=post_params,
_preload_content=_preload_content,
_request_timeout=_request_timeout,
- body=body,
)
elif method == "POST":
- return self.rest_client.POST(
+ return self.rest_client.post_request(
url,
query_params=query_params,
headers=headers,
@@ -478,7 +498,7 @@ def request(
body=body,
)
elif method == "PUT":
- return self.rest_client.PUT(
+ return self.rest_client.put_request(
url,
query_params=query_params,
headers=headers,
@@ -488,7 +508,7 @@ def request(
body=body,
)
elif method == "PATCH":
- return self.rest_client.PATCH(
+ return self.rest_client.patch_request(
url,
query_params=query_params,
headers=headers,
@@ -498,7 +518,7 @@ def request(
body=body,
)
elif method == "DELETE":
- return self.rest_client.DELETE(
+ return self.rest_client.delete_request(
url,
query_params=query_params,
headers=headers,
@@ -538,39 +558,62 @@ def parameters_to_tuples(self, params, collection_formats):
new_params.append((k, v))
return new_params
- @staticmethod
- def get_file_data_and_close_file(file_instance: io.IOBase) -> bytes:
- file_data = file_instance.read()
- file_instance.close()
- return file_data
+ def parameters_to_url_query(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: URL query string (e.g. a=Hello%20World&b=123)
+ """
+ new_params = []
+ if collection_formats is None:
+ collection_formats = {}
+ for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501
+ if isinstance(v, bool):
+ v = str(v).lower()
+ if isinstance(v, (int, float)):
+ v = str(v)
+ if isinstance(v, dict):
+ v = json.dumps(v)
- def files_parameters(self, files: typing.Optional[typing.Dict[str, typing.List[io.IOBase]]] = None):
+ if k in collection_formats:
+ collection_format = collection_formats[k]
+ if collection_format == "multi":
+ new_params.extend((k, quote(str(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(quote(str(value)) for value in v)))
+ else:
+ new_params.append((k, quote(str(v))))
+
+ return "&".join(["=".join(map(str, item)) for item in new_params])
+
+ def files_parameters(self, files=None):
"""Builds form parameters.
- :param files: None or a dict with key=param_name and
- value is a list of open file objects
- :return: List of tuples of form parameters with file data
+ :param files: File parameters.
+ :return: Form parameters with files.
"""
- if files is None:
- return []
-
params = []
- for param_name, file_instances in files.items():
- if file_instances is None:
- # if the file field is nullable, skip None values
- continue
- for file_instance in file_instances:
- if file_instance is None:
- # if the file field is nullable, skip None values
+
+ if files:
+ for k, v in files.items():
+ if not v:
continue
- if file_instance.closed is True:
- raise ApiValueError(
- "Cannot read a closed file. The passed in file_type for %s must be open." % param_name
- )
- filename = os.path.basename(file_instance.name)
- filedata = self.get_file_data_and_close_file(file_instance)
- mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream"
- params.append(tuple([param_name, tuple([filename, filedata, mimetype])]))
+ 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
@@ -583,275 +626,152 @@ def select_header_accept(self, accepts):
if not accepts:
return
- accepts = [x.lower() for x in accepts]
+ for accept in accepts:
+ if re.search("json", accept, re.IGNORECASE):
+ return accept
- if "application/json" in accepts:
- return "application/json"
- else:
- return ", ".join(accepts)
+ return accepts[0]
- def select_header_content_type(self, content_types, method=None, body=None):
+ def select_header_content_type(self, content_types):
"""Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types.
- :param method: http method (e.g. POST, PATCH).
- :param body: http body to send.
:return: Content-Type (e.g. application/json).
"""
if not content_types:
- return "application/json"
+ return None
- content_types = [x.lower() for x in content_types]
+ for content_type in content_types:
+ if re.search("json", content_type, re.IGNORECASE):
+ return content_type
- if method == "PATCH" and "application/json-patch+json" in content_types and isinstance(body, list):
- return "application/json-patch+json"
-
- if "application/json" in content_types or "*/*" in content_types:
- return "application/json"
- else:
- return content_types[0]
+ return content_types[0]
- def update_params_for_auth(self, headers, queries, auth_settings, resource_path, method, body):
+ def update_params_for_auth(self, headers, queries, auth_settings, resource_path, method, body, request_auth=None):
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param queries: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
- :param resource_path: A string representation of the HTTP request resource path.
- :param method: A string representation of the HTTP request method.
- :param body: A object representing the body of the HTTP request.
- The object type is the return value of _encoder.default().
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param request_auth: if set, the provided settings will
+ override the token in the configuration.
"""
if not auth_settings:
return
+ if request_auth:
+ self._apply_auth_params(headers, queries, resource_path, method, body, request_auth)
+ return
+
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
- if auth_setting["in"] == "cookie":
- headers["Cookie"] = auth_setting["value"]
- elif auth_setting["in"] == "header":
- if auth_setting["type"] != "http-signature":
- headers[auth_setting["key"]] = auth_setting["value"]
- elif auth_setting["in"] == "query":
- queries.append((auth_setting["key"], auth_setting["value"]))
- else:
- raise ApiValueError("Authentication token must be in `query` or `header`")
-
-
-class Endpoint(object):
- def __init__(self, settings=None, params_map=None, root_map=None, headers_map=None, api_client=None, callable=None):
- """Creates an endpoint
-
- Args:
- settings (dict): see below key value pairs
- 'response_type' (tuple/None): response type
- 'auth' (list): a list of auth type keys
- 'endpoint_path' (str): the endpoint path
- 'operation_id' (str): endpoint string identifier
- 'http_method' (str): POST/PUT/PATCH/GET etc
- 'servers' (list): list of str servers that this endpoint is at
- params_map (dict): see below key value pairs
- 'all' (list): list of str endpoint parameter names
- 'required' (list): list of required parameter names
- 'nullable' (list): list of nullable parameter names
- 'enum' (list): list of parameters with enum values
- 'validation' (list): list of parameters with validations
- root_map
- 'validations' (dict): the dict mapping endpoint parameter tuple
- paths to their validation dictionaries
- 'allowed_values' (dict): the dict mapping endpoint parameter
- tuple paths to their allowed_values (enum) dictionaries
- 'openapi_types' (dict): param_name to openapi type
- 'attribute_map' (dict): param_name to camelCase name
- 'location_map' (dict): param_name to 'body', 'file', 'form',
- 'header', 'path', 'query'
- collection_format_map (dict): param_name to `csv` etc.
- headers_map (dict): see below key value pairs
- 'accept' (list): list of Accept header strings
- 'content_type' (list): list of Content-Type header strings
- api_client (ApiClient) api client instance
- callable (function): the function which is invoked when the
- Endpoint is called
+ self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting)
+
+ def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting):
+ """Updates the request parameters based on a single auth_setting
+
+ :param headers: Header parameters dict to be updated.
+ :param queries: Query parameters tuple list to be updated.
+ :resource_path: A string representation of the HTTP request resource path.
+ :method: A string representation of the HTTP request method.
+ :body: A object representing the body of the HTTP request.
+ The object type is the return value of sanitize_for_serialization().
+ :param auth_setting: auth settings for the endpoint
"""
- self.settings = settings
- self.params_map = params_map
- self.params_map["all"].extend([
- "async_req",
- "_host_index",
- "_preload_content",
- "_request_timeout",
- "_return_http_data_only",
- "_check_input_type",
- "_check_return_type",
- "_content_type",
- "_spec_property_naming",
- ])
- self.params_map["nullable"].extend(["_request_timeout"])
- self.validations = root_map["validations"]
- self.allowed_values = root_map["allowed_values"]
- self.openapi_types = root_map["openapi_types"]
- extra_types = {
- "async_req": (bool,),
- "_host_index": (none_type, int),
- "_preload_content": (bool,),
- "_request_timeout": (none_type, float, (float,), [float], int, (int,), [int]),
- "_return_http_data_only": (bool,),
- "_check_input_type": (bool,),
- "_check_return_type": (bool,),
- "_spec_property_naming": (bool,),
- "_content_type": (none_type, str),
- }
- self.openapi_types.update(extra_types)
- self.attribute_map = root_map["attribute_map"]
- self.location_map = root_map["location_map"]
- self.collection_format_map = root_map["collection_format_map"]
- self.headers_map = headers_map
- self.api_client = api_client
- self.callable = callable
-
- def __validate_inputs(self, kwargs):
- for param in self.params_map["enum"]:
- if param in kwargs:
- check_allowed_values(self.allowed_values, (param,), kwargs[param])
-
- for param in self.params_map["validation"]:
- if param in kwargs:
- check_validations(
- self.validations, (param,), kwargs[param], configuration=self.api_client.configuration
- )
-
- if kwargs["_check_input_type"] is False:
- return
+ if auth_setting["in"] == "cookie":
+ headers["Cookie"] = auth_setting["value"]
+ elif auth_setting["in"] == "header":
+ if auth_setting["type"] != "http-signature":
+ headers[auth_setting["key"]] = auth_setting["value"]
+ elif auth_setting["in"] == "query":
+ queries.append((auth_setting["key"], auth_setting["value"]))
+ else:
+ raise ApiValueError("Authentication token must be in `query` or `header`")
- for key, value in kwargs.items():
- fixed_val = validate_and_convert_types(
- value,
- self.openapi_types[key],
- [key],
- kwargs["_spec_property_naming"],
- kwargs["_check_input_type"],
- configuration=self.api_client.configuration,
- )
- kwargs[key] = fixed_val
-
- def __gather_params(self, kwargs):
- params = {"body": None, "collection_format": {}, "file": {}, "form": [], "header": {}, "path": {}, "query": []}
-
- for param_name, param_value in kwargs.items():
- param_location = self.location_map.get(param_name)
- if param_location is None:
- continue
- if param_location:
- if param_location == "body":
- params["body"] = param_value
- continue
- base_name = self.attribute_map[param_name]
- if param_location == "form" and self.openapi_types[param_name] == (file_type,):
- params["file"][base_name] = [param_value]
- elif param_location == "form" and self.openapi_types[param_name] == ([file_type],):
- # param_value is already a list
- params["file"][base_name] = param_value
- elif param_location in {"form", "query"}:
- param_value_full = (base_name, param_value)
- params[param_location].append(param_value_full)
- if param_location not in {"form", "query"}:
- params[param_location][base_name] = param_value
- collection_format = self.collection_format_map.get(param_name)
- if collection_format:
- params["collection_format"][base_name] = collection_format
+ def __deserialize_file(self, response):
+ """Deserializes body to file
- return params
+ 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.
- def __call__(self, *args, **kwargs):
- """This method is invoked when endpoints are called
- Example:
+ :return: int, long, float, str, bool.
+ """
+ try:
+ return klass(data)
+ except UnicodeEncodeError:
+ return str(data)
+ except TypeError:
+ return data
- api_instance = ActionsApi()
- api_instance.create_rule # this is an instance of the class Endpoint
- api_instance.create_rule() # this invokes api_instance.create_rule.__call__()
- which then invokes the callable functions stored in that endpoint at
- api_instance.create_rule.callable or self.callable in this class
+ def __deserialize_object(self, value):
+ """Return an original value.
+ :return: object.
"""
- return self.callable(self, *args, **kwargs)
+ return value
- def call_with_http_info(self, **kwargs):
+ def __deserialize_date(self, string):
+ """Deserializes string to date.
+ :param string: str.
+ :return: date.
+ """
try:
- index = (
- self.api_client.configuration.server_operation_index.get(
- self.settings["operation_id"], self.api_client.configuration.server_index
- )
- if kwargs["_host_index"] is None
- else kwargs["_host_index"]
- )
- server_variables = self.api_client.configuration.server_operation_variables.get(
- self.settings["operation_id"], self.api_client.configuration.server_variables
- )
- _host = self.api_client.configuration.get_host_from_settings(
- index, variables=server_variables, servers=self.settings["servers"]
- )
- except IndexError:
- if self.settings["servers"]:
- raise ApiValueError("Invalid host index. Must be 0 <= index < %s" % len(self.settings["servers"]))
- _host = None
-
- for key, value in kwargs.items():
- if key not in self.params_map["all"]:
- raise ApiTypeError(
- "Got an unexpected parameter '%s' to method `%s`" % (key, self.settings["operation_id"])
- )
- # only throw this nullable ApiValueError if _check_input_type
- # is False, if _check_input_type==True we catch this case
- # in self.__validate_inputs
- if key not in self.params_map["nullable"] and value is None and kwargs["_check_input_type"] is False:
- raise ApiValueError(
- "Value may not be None for non-nullable parameter `%s` when calling `%s`"
- % (key, self.settings["operation_id"])
- )
-
- for key in self.params_map["required"]:
- if key not in kwargs.keys():
- raise ApiValueError(
- "Missing the required parameter `%s` when calling `%s`" % (key, self.settings["operation_id"])
- )
-
- self.__validate_inputs(kwargs)
-
- params = self.__gather_params(kwargs)
-
- accept_headers_list = self.headers_map["accept"]
- if accept_headers_list:
- params["header"]["Accept"] = self.api_client.select_header_accept(accept_headers_list)
-
- if kwargs.get("_content_type"):
- params["header"]["Content-Type"] = kwargs["_content_type"]
- else:
- content_type_headers_list = self.headers_map["content_type"]
- if content_type_headers_list:
- if params["body"] != "":
- header_list = self.api_client.select_header_content_type(
- content_type_headers_list, self.settings["http_method"], params["body"]
- )
- params["header"]["Content-Type"] = header_list
-
- return self.api_client.call_api(
- self.settings["endpoint_path"],
- self.settings["http_method"],
- params["path"],
- params["query"],
- params["header"],
- body=params["body"],
- post_params=params["form"],
- files=params["file"],
- response_type=self.settings["response_type"],
- auth_settings=self.settings["auth"],
- async_req=kwargs["async_req"],
- _check_type=kwargs["_check_return_type"],
- _return_http_data_only=kwargs["_return_http_data_only"],
- _preload_content=kwargs["_preload_content"],
- _request_timeout=kwargs["_request_timeout"],
- _host=_host,
- collection_formats=params["collection_format"],
- )
+ 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_datetime(self, string):
+ """Deserializes string to datetime.
+
+ The string should be in iso8601 datetime format.
+
+ :param string: str.
+ :return: datetime.
+ """
+ try:
+ 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.
+ """
+
+ return klass.from_dict(data)
diff --git a/generated/groundlight_openapi_client/api_response.py b/generated/groundlight_openapi_client/api_response.py
new file mode 100644
index 00000000..7bc03cb6
--- /dev/null
+++ b/generated/groundlight_openapi_client/api_response.py
@@ -0,0 +1,22 @@
+"""API response object."""
+
+from __future__ import annotations
+from typing import Any, Dict, Optional
+from pydantic import Field, StrictInt, StrictStr
+
+
+class ApiResponse:
+ """
+ API response object
+ """
+
+ status_code: Optional[StrictInt] = Field(None, description="HTTP status code")
+ headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers")
+ data: Optional[Any] = Field(None, description="Deserialized data given the data type")
+ raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)")
+
+ def __init__(self, status_code=None, headers=None, data=None, raw_data=None) -> None:
+ self.status_code = status_code
+ self.headers = headers
+ self.data = data
+ self.raw_data = raw_data
diff --git a/generated/groundlight_openapi_client/apis/__init__.py b/generated/groundlight_openapi_client/apis/__init__.py
deleted file mode 100644
index 28edf7d0..00000000
--- a/generated/groundlight_openapi_client/apis/__init__.py
+++ /dev/null
@@ -1,24 +0,0 @@
-# flake8: noqa
-
-# Import all APIs into this package.
-# If you have many APIs here with many many models used in each API this may
-# raise a `RecursionError`.
-# In order to avoid this, import only the API that you directly need like:
-#
-# from .api.actions_api import ActionsApi
-#
-# or import this package, but before doing it, use:
-#
-# import sys
-# sys.setrecursionlimit(n)
-
-# Import APIs into API package:
-from groundlight_openapi_client.api.actions_api import ActionsApi
-from groundlight_openapi_client.api.detector_groups_api import DetectorGroupsApi
-from groundlight_openapi_client.api.detector_reset_api import DetectorResetApi
-from groundlight_openapi_client.api.detectors_api import DetectorsApi
-from groundlight_openapi_client.api.edge_api import EdgeApi
-from groundlight_openapi_client.api.image_queries_api import ImageQueriesApi
-from groundlight_openapi_client.api.labels_api import LabelsApi
-from groundlight_openapi_client.api.notes_api import NotesApi
-from groundlight_openapi_client.api.user_api import UserApi
diff --git a/generated/groundlight_openapi_client/configuration.py b/generated/groundlight_openapi_client/configuration.py
index 654b832f..261f7b3b 100644
--- a/generated/groundlight_openapi_client/configuration.py
+++ b/generated/groundlight_openapi_client/configuration.py
@@ -1,12 +1,17 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import copy
import logging
@@ -14,9 +19,7 @@
import sys
import urllib3
-from http import client as http_client
-from groundlight_openapi_client.exceptions import ApiValueError
-
+import http.client as httplib
JSON_SCHEMA_VALIDATION_KEYWORDS = {
"multipleOf",
@@ -32,46 +35,20 @@
}
-class Configuration(object):
- """NOTE: This class is auto generated by OpenAPI Generator
-
- Ref: https://openapi-generator.tech
- Do not edit the class manually.
+class Configuration:
+ """This class contains various settings of the API client.
- :param host: Base url
+ :param host: Base url.
:param api_key: Dict to store API key(s).
Each entry in the dict specifies an API key.
The dict key is the name of the security scheme in the OAS specification.
The dict value is the API key secret.
- :param api_key_prefix: Dict to store API prefix (e.g. Bearer)
+ :param api_key_prefix: Dict to store API prefix (e.g. Bearer).
The dict key is the name of the security scheme in the OAS specification.
The dict value is an API key prefix when generating the auth data.
- :param username: Username for HTTP basic authentication
- :param password: Password for HTTP basic authentication
- :param discard_unknown_keys: Boolean value indicating whether to discard
- unknown properties. A server may send a response that includes additional
- properties that are not known by the client in the following scenarios:
- 1. The OpenAPI document is incomplete, i.e. it does not match the server
- implementation.
- 2. The client was generated using an older version of the OpenAPI document
- and the server has been upgraded since then.
- If a schema in the OpenAPI document defines the additionalProperties attribute,
- then all undeclared properties received by the server are injected into the
- additional properties map. In that case, there are undeclared properties, and
- nothing to discard.
- :param disabled_client_side_validations (string): Comma-separated list of
- JSON schema validation keywords to disable JSON schema structural validation
- rules. The following keywords may be specified: multipleOf, maximum,
- exclusiveMaximum, minimum, exclusiveMinimum, maxLength, minLength, pattern,
- maxItems, minItems.
- By default, the validation is performed for data generated locally by the client
- and data received from the server, independent of any validation performed by
- the server side. If the input data does not satisfy the JSON schema validation
- rules specified in the OpenAPI document, an exception is raised.
- If disabled_client_side_validations is set, structural validation is
- disabled. This can be useful to troubleshoot data validation problem, such as
- when the OpenAPI document validation rules do not match the actual API data
- received by the server.
+ :param username: Username for HTTP basic authentication.
+ :param password: Password for HTTP basic authentication.
+ :param access_token: Access token.
:param server_index: Index to servers configuration.
:param server_variables: Mapping with string values to replace variables in
templated server configuration. The validation of enums is performed for
@@ -80,9 +57,10 @@ class Configuration(object):
configuration.
:param server_operation_variables: Mapping from operation ID to a mapping with
string values to replace variables in templated server configuration.
- The validation of enums is performed for variables with defined enum values before.
+ The validation of enums is performed for variables with defined enum
+ values before.
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
- in PEM format
+ in PEM format.
:Example:
@@ -113,17 +91,15 @@ def __init__(
host=None,
api_key=None,
api_key_prefix=None,
- access_token=None,
username=None,
password=None,
- discard_unknown_keys=False,
- disabled_client_side_validations="",
+ access_token=None,
server_index=None,
server_variables=None,
server_operation_index=None,
server_operation_variables=None,
ssl_ca_cert=None,
- ):
+ ) -> None:
"""Constructor"""
self._base_path = "https://api.groundlight.ai/device-api" if host is None else host
"""Default Base url
@@ -140,7 +116,6 @@ def __init__(
"""Temp file folder for downloading files
"""
# Authentication Settings
- self.access_token = access_token
self.api_key = {}
if api_key:
self.api_key = api_key
@@ -160,8 +135,9 @@ def __init__(
self.password = password
"""Password for HTTP basic authentication
"""
- self.discard_unknown_keys = discard_unknown_keys
- self.disabled_client_side_validations = disabled_client_side_validations
+ self.access_token = access_token
+ """Access token
+ """
self.logger = {}
"""Logging Settings
"""
@@ -200,6 +176,10 @@ def __init__(
self.assert_hostname = None
"""Set this to True/False to enable/disable SSL hostname verification.
"""
+ self.tls_server_name = None
+ """SSL/TLS Server Name Indication (SNI)
+ Set this to the SNI value expected by the server.
+ """
self.connection_pool_maxsize = multiprocessing.cpu_count() * 5
"""urllib3 connection pool's maximum number of connections saved
@@ -212,9 +192,6 @@ def __init__(
self.proxy = None
"""Proxy URL
"""
- self.no_proxy = None
- """bypass proxy for host in the no_proxy list.
- """
self.proxy_headers = None
"""Proxy headers
"""
@@ -227,8 +204,17 @@ def __init__(
# Enable client side validation
self.client_side_validation = True
- # Options to pass down to the underlying urllib3 socket
self.socket_options = None
+ """Options to pass down to the underlying urllib3 socket
+ """
+
+ self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
+ """datetime format
+ """
+
+ self.date_format = "%Y-%m-%d"
+ """date format
+ """
def __deepcopy__(self, memo):
cls = self.__class__
@@ -246,12 +232,6 @@ def __deepcopy__(self, memo):
def __setattr__(self, name, value):
object.__setattr__(self, name, value)
- if name == "disabled_client_side_validations":
- s = set(filter(None, value.split(",")))
- for v in s:
- if v not in JSON_SCHEMA_VALIDATION_KEYWORDS:
- raise ApiValueError("Invalid keyword: '{0}''".format(v))
- self._disabled_client_side_validations = s
@classmethod
def set_default(cls, default):
@@ -262,21 +242,31 @@ def set_default(cls, default):
:param default: object of Configuration
"""
- cls._default = copy.deepcopy(default)
+ cls._default = default
@classmethod
def get_default_copy(cls):
- """Return new instance of configuration.
+ """Deprecated. Please use `get_default` instead.
+
+ Deprecated. Please use `get_default` instead.
+
+ :return: The configuration object.
+ """
+ return cls.get_default()
+
+ @classmethod
+ def get_default(cls):
+ """Return the default configuration.
This method returns newly created, based on default constructor,
object of Configuration class or returns a copy of default
- configuration passed by the set_default method.
+ configuration.
:return: The configuration object.
"""
- if cls._default is not None:
- return copy.deepcopy(cls._default)
- return Configuration()
+ if cls._default is None:
+ cls._default = Configuration()
+ return cls._default
@property
def logger_file(self):
@@ -330,15 +320,15 @@ def debug(self, value):
# if debug status is True, turn on debug logging
for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
- # turn on http_client debug
- http_client.HTTPConnection.debuglevel = 1
+ # turn on httplib debug
+ 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.logger.items():
logger.setLevel(logging.WARNING)
- # turn off http_client debug
- http_client.HTTPConnection.debuglevel = 0
+ # turn off httplib debug
+ httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
diff --git a/generated/groundlight_openapi_client/exceptions.py b/generated/groundlight_openapi_client/exceptions.py
index 393dbba8..8686286a 100644
--- a/generated/groundlight_openapi_client/exceptions.py
+++ b/generated/groundlight_openapi_client/exceptions.py
@@ -1,12 +1,16 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
class OpenApiException(Exception):
@@ -14,7 +18,7 @@ class OpenApiException(Exception):
class ApiTypeError(OpenApiException, TypeError):
- def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None):
+ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> None:
"""Raises an exception for TypeErrors
Args:
@@ -42,7 +46,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None):
class ApiValueError(OpenApiException, ValueError):
- def __init__(self, msg, path_to_item=None):
+ def __init__(self, msg, path_to_item=None) -> None:
"""
Args:
msg (str): the exception message
@@ -60,7 +64,7 @@ def __init__(self, msg, path_to_item=None):
class ApiAttributeError(OpenApiException, AttributeError):
- def __init__(self, msg, path_to_item=None):
+ def __init__(self, msg, path_to_item=None) -> None:
"""
Raised when an attribute reference or assignment fails.
@@ -79,7 +83,7 @@ def __init__(self, msg, path_to_item=None):
class ApiKeyError(OpenApiException, KeyError):
- def __init__(self, msg, path_to_item=None):
+ def __init__(self, msg, path_to_item=None) -> None:
"""
Args:
msg (str): the exception message
@@ -96,7 +100,7 @@ def __init__(self, msg, path_to_item=None):
class ApiException(OpenApiException):
- def __init__(self, status=None, reason=None, http_resp=None):
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
if http_resp:
self.status = http_resp.status
self.reason = http_resp.reason
@@ -120,23 +124,28 @@ def __str__(self):
return error_message
+class BadRequestException(ApiException):
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
+ super(BadRequestException, self).__init__(status, reason, http_resp)
+
+
class NotFoundException(ApiException):
- def __init__(self, status=None, reason=None, http_resp=None):
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(NotFoundException, self).__init__(status, reason, http_resp)
class UnauthorizedException(ApiException):
- def __init__(self, status=None, reason=None, http_resp=None):
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(UnauthorizedException, self).__init__(status, reason, http_resp)
class ForbiddenException(ApiException):
- def __init__(self, status=None, reason=None, http_resp=None):
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(ForbiddenException, self).__init__(status, reason, http_resp)
class ServiceException(ApiException):
- def __init__(self, status=None, reason=None, http_resp=None):
+ def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(ServiceException, self).__init__(status, reason, http_resp)
diff --git a/generated/groundlight_openapi_client/model/__init__.py b/generated/groundlight_openapi_client/model/__init__.py
deleted file mode 100644
index cfe32b78..00000000
--- a/generated/groundlight_openapi_client/model/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# we can not import model classes here because that would create a circular
-# reference which would not work in python2
-# do not import all models into this module because that uses a lot of memory and stack frames
-# if you need the ability to import all models from one package, import them with
-# from {{packageName}.models import ModelA, ModelB
diff --git a/generated/groundlight_openapi_client/model/action.py b/generated/groundlight_openapi_client/model/action.py
deleted file mode 100644
index 8308d44b..00000000
--- a/generated/groundlight_openapi_client/model/action.py
+++ /dev/null
@@ -1,294 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.channel_enum import ChannelEnum
-
- globals()["ChannelEnum"] = ChannelEnum
-
-
-class Action(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "channel": (ChannelEnum,), # noqa: E501
- "recipient": (str,), # noqa: E501
- "include_image": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "channel": "channel", # noqa: E501
- "recipient": "recipient", # noqa: E501
- "include_image": "include_image", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, channel, recipient, include_image, *args, **kwargs): # noqa: E501
- """Action - a model defined in OpenAPI
-
- Args:
- channel (ChannelEnum):
- recipient (str):
- include_image (bool):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.channel = channel
- self.recipient = recipient
- self.include_image = include_image
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, channel, recipient, include_image, *args, **kwargs): # noqa: E501
- """Action - a model defined in OpenAPI
-
- Args:
- channel (ChannelEnum):
- recipient (str):
- include_image (bool):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.channel = channel
- self.recipient = recipient
- self.include_image = include_image
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/action_list.py b/generated/groundlight_openapi_client/model/action_list.py
deleted file mode 100644
index a38fae04..00000000
--- a/generated/groundlight_openapi_client/model/action_list.py
+++ /dev/null
@@ -1,285 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.action import Action
-
- globals()["Action"] = Action
-
-
-class ActionList(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "value": ([Action],),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """ActionList - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] ([Action]): # noqa: E501
-
- Keyword Args:
- value ([Action]): # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """ActionList - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] ([Action]): # noqa: E501
-
- Keyword Args:
- value ([Action]): # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/action_request.py b/generated/groundlight_openapi_client/model/action_request.py
deleted file mode 100644
index 921399b4..00000000
--- a/generated/groundlight_openapi_client/model/action_request.py
+++ /dev/null
@@ -1,298 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.15.3
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.channel_enum import ChannelEnum
-
- globals()["ChannelEnum"] = ChannelEnum
-
-
-class ActionRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("recipient",): {
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "channel": (ChannelEnum,), # noqa: E501
- "recipient": (str,), # noqa: E501
- "include_image": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "channel": "channel", # noqa: E501
- "recipient": "recipient", # noqa: E501
- "include_image": "include_image", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, channel, recipient, include_image, *args, **kwargs): # noqa: E501
- """ActionRequest - a model defined in OpenAPI
-
- Args:
- channel (ChannelEnum):
- recipient (str):
- include_image (bool):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.channel = channel
- self.recipient = recipient
- self.include_image = include_image
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, channel, recipient, include_image, *args, **kwargs): # noqa: E501
- """ActionRequest - a model defined in OpenAPI
-
- Args:
- channel (ChannelEnum):
- recipient (str):
- include_image (bool):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.channel = channel
- self.recipient = recipient
- self.include_image = include_image
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/all_notes.py b/generated/groundlight_openapi_client/model/all_notes.py
deleted file mode 100644
index 89da5af1..00000000
--- a/generated/groundlight_openapi_client/model/all_notes.py
+++ /dev/null
@@ -1,288 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.note import Note
-
- globals()["Note"] = Note
-
-
-class AllNotes(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "customer": ([Note],), # noqa: E501
- "gl": ([Note],), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "customer": "CUSTOMER", # noqa: E501
- "gl": "GL", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, customer, gl, *args, **kwargs): # noqa: E501
- """AllNotes - a model defined in OpenAPI
-
- Args:
- customer ([Note]):
- gl ([Note]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.customer = customer
- self.gl = gl
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, customer, gl, *args, **kwargs): # noqa: E501
- """AllNotes - a model defined in OpenAPI
-
- Args:
- customer ([Note]):
- gl ([Note]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.customer = customer
- self.gl = gl
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/annotations_requested_enum.py b/generated/groundlight_openapi_client/model/annotations_requested_enum.py
deleted file mode 100644
index 1e1f6b8f..00000000
--- a/generated/groundlight_openapi_client/model/annotations_requested_enum.py
+++ /dev/null
@@ -1,283 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class AnnotationsRequestedEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "BINARY_CLASSIFICATION": "BINARY_CLASSIFICATION",
- "BOUNDING_BOXES": "BOUNDING_BOXES",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """AnnotationsRequestedEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """AnnotationsRequestedEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["BINARY_CLASSIFICATION", "BOUNDING_BOXES", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/b_box_geometry.py b/generated/groundlight_openapi_client/model/b_box_geometry.py
deleted file mode 100644
index 2282dfd7..00000000
--- a/generated/groundlight_openapi_client/model/b_box_geometry.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class BBoxGeometry(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "left": (float,), # noqa: E501
- "top": (float,), # noqa: E501
- "right": (float,), # noqa: E501
- "bottom": (float,), # noqa: E501
- "x": (float,), # noqa: E501
- "y": (float,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "left": "left", # noqa: E501
- "top": "top", # noqa: E501
- "right": "right", # noqa: E501
- "bottom": "bottom", # noqa: E501
- "x": "x", # noqa: E501
- "y": "y", # noqa: E501
- }
-
- read_only_vars = {
- "x", # noqa: E501
- "y", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, left, top, right, bottom, x, y, *args, **kwargs): # noqa: E501
- """BBoxGeometry - a model defined in OpenAPI
-
- Args:
- left (float):
- top (float):
- right (float):
- bottom (float):
- x (float):
- y (float):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.left = left
- self.top = top
- self.right = right
- self.bottom = bottom
- self.x = x
- self.y = y
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, left, top, right, bottom, *args, **kwargs): # noqa: E501
- """BBoxGeometry - a model defined in OpenAPI
-
- Args:
- left (float):
- top (float):
- right (float):
- bottom (float):
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.left = left
- self.top = top
- self.right = right
- self.bottom = bottom
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/b_box_geometry_request.py b/generated/groundlight_openapi_client/model/b_box_geometry_request.py
deleted file mode 100644
index fcac579f..00000000
--- a/generated/groundlight_openapi_client/model/b_box_geometry_request.py
+++ /dev/null
@@ -1,292 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class BBoxGeometryRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "left": (float,), # noqa: E501
- "top": (float,), # noqa: E501
- "right": (float,), # noqa: E501
- "bottom": (float,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "left": "left", # noqa: E501
- "top": "top", # noqa: E501
- "right": "right", # noqa: E501
- "bottom": "bottom", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, left, top, right, bottom, *args, **kwargs): # noqa: E501
- """BBoxGeometryRequest - a model defined in OpenAPI
-
- Args:
- left (float):
- top (float):
- right (float):
- bottom (float):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.left = left
- self.top = top
- self.right = right
- self.bottom = bottom
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, left, top, right, bottom, *args, **kwargs): # noqa: E501
- """BBoxGeometryRequest - a model defined in OpenAPI
-
- Args:
- left (float):
- top (float):
- right (float):
- bottom (float):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.left = left
- self.top = top
- self.right = right
- self.bottom = bottom
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/binary_classification_result.py b/generated/groundlight_openapi_client/model/binary_classification_result.py
deleted file mode 100644
index 018a6f3e..00000000
--- a/generated/groundlight_openapi_client/model/binary_classification_result.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class BinaryClassificationResult(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("result_type",): {
- "BINARY_CLASSIFICATION": "binary_classification",
- },
- }
-
- validations = {
- ("confidence",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "label": (str,), # noqa: E501
- "confidence": (
- float,
- none_type,
- ), # noqa: E501
- "source": (str,), # noqa: E501
- "result_type": (str,), # noqa: E501
- "from_edge": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "label": "label", # noqa: E501
- "confidence": "confidence", # noqa: E501
- "source": "source", # noqa: E501
- "result_type": "result_type", # noqa: E501
- "from_edge": "from_edge", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501
- """BinaryClassificationResult - a model defined in OpenAPI
-
- Args:
- label (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, label, *args, **kwargs): # noqa: E501
- """BinaryClassificationResult - a model defined in OpenAPI
-
- Args:
- label (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/blank_enum.py b/generated/groundlight_openapi_client/model/blank_enum.py
deleted file mode 100644
index aa466bb8..00000000
--- a/generated/groundlight_openapi_client/model/blank_enum.py
+++ /dev/null
@@ -1,274 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class BlankEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "EMPTY": "",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """BlankEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): if omitted defaults to "", must be one of ["", ] # noqa: E501
-
- Keyword Args:
- value (str): if omitted defaults to "", must be one of ["", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- value = ""
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """BlankEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): if omitted defaults to "", must be one of ["", ] # noqa: E501
-
- Keyword Args:
- value (str): if omitted defaults to "", must be one of ["", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- value = ""
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/bounding_box_mode_configuration.py b/generated/groundlight_openapi_client/model/bounding_box_mode_configuration.py
deleted file mode 100644
index bcf98f27..00000000
--- a/generated/groundlight_openapi_client/model/bounding_box_mode_configuration.py
+++ /dev/null
@@ -1,283 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class BoundingBoxModeConfiguration(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("max_num_bboxes",): {
- "inclusive_maximum": 50,
- "inclusive_minimum": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "class_name": (str,), # noqa: E501
- "max_num_bboxes": (int,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "class_name": "class_name", # noqa: E501
- "max_num_bboxes": "max_num_bboxes", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
- """BoundingBoxModeConfiguration - a model defined in OpenAPI
-
- Args:
- class_name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- max_num_bboxes (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.class_name = class_name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, class_name, *args, **kwargs): # noqa: E501
- """BoundingBoxModeConfiguration - a model defined in OpenAPI
-
- Args:
- class_name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- max_num_bboxes (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.class_name = class_name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/bounding_box_result.py b/generated/groundlight_openapi_client/model/bounding_box_result.py
deleted file mode 100644
index 8fc4c417..00000000
--- a/generated/groundlight_openapi_client/model/bounding_box_result.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class BoundingBoxResult(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("result_type",): {
- "BOUNDING_BOX": "bounding_box",
- },
- }
-
- validations = {
- ("confidence",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "label": (str,), # noqa: E501
- "confidence": (
- float,
- none_type,
- ), # noqa: E501
- "source": (str,), # noqa: E501
- "result_type": (str,), # noqa: E501
- "from_edge": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "label": "label", # noqa: E501
- "confidence": "confidence", # noqa: E501
- "source": "source", # noqa: E501
- "result_type": "result_type", # noqa: E501
- "from_edge": "from_edge", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501
- """BoundingBoxResult - a model defined in OpenAPI
-
- Args:
- label (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "bounding_box" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, label, *args, **kwargs): # noqa: E501
- """BoundingBoxResult - a model defined in OpenAPI
-
- Args:
- label (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "bounding_box" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/channel_enum.py b/generated/groundlight_openapi_client/model/channel_enum.py
deleted file mode 100644
index 720dac0d..00000000
--- a/generated/groundlight_openapi_client/model/channel_enum.py
+++ /dev/null
@@ -1,283 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class ChannelEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "TEXT": "TEXT",
- "EMAIL": "EMAIL",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """ChannelEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["TEXT", "EMAIL", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["TEXT", "EMAIL", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """ChannelEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["TEXT", "EMAIL", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["TEXT", "EMAIL", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/condition.py b/generated/groundlight_openapi_client/model/condition.py
deleted file mode 100644
index 65a2861f..00000000
--- a/generated/groundlight_openapi_client/model/condition.py
+++ /dev/null
@@ -1,280 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class Condition(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "verb": (str,), # noqa: E501
- "parameters": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "verb": "verb", # noqa: E501
- "parameters": "parameters", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, verb, parameters, *args, **kwargs): # noqa: E501
- """Condition - a model defined in OpenAPI
-
- Args:
- verb (str):
- parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.verb = verb
- self.parameters = parameters
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, verb, parameters, *args, **kwargs): # noqa: E501
- """Condition - a model defined in OpenAPI
-
- Args:
- verb (str):
- parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.verb = verb
- self.parameters = parameters
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/condition_request.py b/generated/groundlight_openapi_client/model/condition_request.py
deleted file mode 100644
index 674578a6..00000000
--- a/generated/groundlight_openapi_client/model/condition_request.py
+++ /dev/null
@@ -1,280 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class ConditionRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "verb": (str,), # noqa: E501
- "parameters": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "verb": "verb", # noqa: E501
- "parameters": "parameters", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, verb, parameters, *args, **kwargs): # noqa: E501
- """ConditionRequest - a model defined in OpenAPI
-
- Args:
- verb (str):
- parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.verb = verb
- self.parameters = parameters
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, verb, parameters, *args, **kwargs): # noqa: E501
- """ConditionRequest - a model defined in OpenAPI
-
- Args:
- verb (str):
- parameters ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.verb = verb
- self.parameters = parameters
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/count_mode_configuration.py b/generated/groundlight_openapi_client/model/count_mode_configuration.py
deleted file mode 100644
index 9c2d3be9..00000000
--- a/generated/groundlight_openapi_client/model/count_mode_configuration.py
+++ /dev/null
@@ -1,283 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class CountModeConfiguration(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("max_count",): {
- "inclusive_maximum": 50,
- "inclusive_minimum": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "class_name": (str,), # noqa: E501
- "max_count": (int,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "class_name": "class_name", # noqa: E501
- "max_count": "max_count", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, class_name, *args, **kwargs): # noqa: E501
- """CountModeConfiguration - a model defined in OpenAPI
-
- Args:
- class_name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- max_count (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.class_name = class_name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, class_name, *args, **kwargs): # noqa: E501
- """CountModeConfiguration - a model defined in OpenAPI
-
- Args:
- class_name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- max_count (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.class_name = class_name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/count_mode_configuration_serializer.py b/generated/groundlight_openapi_client/model/count_mode_configuration_serializer.py
deleted file mode 100644
index 5b2d0dda..00000000
--- a/generated/groundlight_openapi_client/model/count_mode_configuration_serializer.py
+++ /dev/null
@@ -1,280 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.15.3
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class CountModeConfigurationSerializer(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "id": (str,), # noqa: E501
- "max_count": (int,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "id": "id", # noqa: E501
- "max_count": "max_count", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, id, max_count, *args, **kwargs): # noqa: E501
- """CountModeConfigurationSerializer - a model defined in OpenAPI
-
- Args:
- id (str):
- max_count (int):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.id = id
- self.max_count = max_count
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, id, max_count, *args, **kwargs): # noqa: E501
- """CountModeConfigurationSerializer - a model defined in OpenAPI
-
- Args:
- id (str):
- max_count (int):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.id = id
- self.max_count = max_count
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/counting_result.py b/generated/groundlight_openapi_client/model/counting_result.py
deleted file mode 100644
index 85e692e5..00000000
--- a/generated/groundlight_openapi_client/model/counting_result.py
+++ /dev/null
@@ -1,312 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class CountingResult(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("result_type",): {
- "COUNTING": "counting",
- },
- }
-
- validations = {
- ("count",): {
- "inclusive_minimum": 0,
- },
- ("confidence",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "count": (
- int,
- none_type,
- ), # noqa: E501
- "confidence": (
- float,
- none_type,
- ), # noqa: E501
- "source": (str,), # noqa: E501
- "result_type": (str,), # noqa: E501
- "from_edge": (bool,), # noqa: E501
- "greater_than_max": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "count": "count", # noqa: E501
- "confidence": "confidence", # noqa: E501
- "source": "source", # noqa: E501
- "result_type": "result_type", # noqa: E501
- "from_edge": "from_edge", # noqa: E501
- "greater_than_max": "greater_than_max", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, count, *args, **kwargs): # noqa: E501
- """CountingResult - a model defined in OpenAPI
-
- Args:
- count (int, none_type):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "counting" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- greater_than_max (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, count, *args, **kwargs): # noqa: E501
- """CountingResult - a model defined in OpenAPI
-
- Args:
- count (int, none_type):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "counting" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- greater_than_max (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/detector.py b/generated/groundlight_openapi_client/model/detector.py
deleted file mode 100644
index 2cde7991..00000000
--- a/generated/groundlight_openapi_client/model/detector.py
+++ /dev/null
@@ -1,381 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.blank_enum import BlankEnum
- from groundlight_openapi_client.model.detector_type_enum import DetectorTypeEnum
- from groundlight_openapi_client.model.status_enum import StatusEnum
-
- globals()["BlankEnum"] = BlankEnum
- globals()["DetectorTypeEnum"] = DetectorTypeEnum
- globals()["StatusEnum"] = StatusEnum
-
-
-class Detector(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 200,
- },
- ("confidence_threshold",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- ("patience_time",): {
- "inclusive_maximum": 3600,
- "inclusive_minimum": 0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "id": (str,), # noqa: E501
- "type": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "created_at": (datetime,), # noqa: E501
- "name": (str,), # noqa: E501
- "query": (str,), # noqa: E501
- "group_name": (str,), # noqa: E501
- "metadata": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "mode": (str,), # noqa: E501
- "mode_configuration": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "confidence_threshold": (float,), # noqa: E501
- "patience_time": (float,), # noqa: E501
- "status": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "escalation_type": (str,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "id": "id", # noqa: E501
- "type": "type", # noqa: E501
- "created_at": "created_at", # noqa: E501
- "name": "name", # noqa: E501
- "query": "query", # noqa: E501
- "group_name": "group_name", # noqa: E501
- "metadata": "metadata", # noqa: E501
- "mode": "mode", # noqa: E501
- "mode_configuration": "mode_configuration", # noqa: E501
- "confidence_threshold": "confidence_threshold", # noqa: E501
- "patience_time": "patience_time", # noqa: E501
- "status": "status", # noqa: E501
- "escalation_type": "escalation_type", # noqa: E501
- }
-
- read_only_vars = {
- "id", # noqa: E501
- "type", # noqa: E501
- "created_at", # noqa: E501
- "query", # noqa: E501
- "group_name", # noqa: E501
- "metadata", # noqa: E501
- "mode", # noqa: E501
- "mode_configuration", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(
- cls, id, type, created_at, name, query, group_name, metadata, mode, mode_configuration, *args, **kwargs
- ): # noqa: E501
- """Detector - a model defined in OpenAPI
-
- Args:
- id (str): A unique ID for this object.
- type (bool, date, datetime, dict, float, int, list, str, none_type): The type of this object.
- created_at (datetime): When this detector was created.
- name (str): A short, descriptive name for the detector.
- query (str): A question about the image.
- group_name (str): Which group should this detector be part of?
- metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Metadata about the detector.
- mode (str):
- mode_configuration ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- escalation_type (str): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.id = id
- self.type = type
- self.created_at = created_at
- self.name = name
- self.query = query
- self.group_name = group_name
- self.metadata = metadata
- self.mode = mode
- self.mode_configuration = mode_configuration
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, name, *args, **kwargs): # noqa: E501
- """Detector - a model defined in OpenAPI
-
- name (str): A short, descriptive name for the detector.
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- escalation_type (str): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/detector_creation_input_request.py b/generated/groundlight_openapi_client/model/detector_creation_input_request.py
deleted file mode 100644
index ca1b1563..00000000
--- a/generated/groundlight_openapi_client/model/detector_creation_input_request.py
+++ /dev/null
@@ -1,375 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.bounding_box_mode_configuration import BoundingBoxModeConfiguration
- from groundlight_openapi_client.model.count_mode_configuration import CountModeConfiguration
- from groundlight_openapi_client.model.mode_enum import ModeEnum
- from groundlight_openapi_client.model.multi_class_mode_configuration import MultiClassModeConfiguration
- from groundlight_openapi_client.model.text_mode_configuration import TextModeConfiguration
-
- globals()["BoundingBoxModeConfiguration"] = BoundingBoxModeConfiguration
- globals()["CountModeConfiguration"] = CountModeConfiguration
- globals()["ModeEnum"] = ModeEnum
- globals()["MultiClassModeConfiguration"] = MultiClassModeConfiguration
- globals()["TextModeConfiguration"] = TextModeConfiguration
-
-
-class DetectorCreationInputRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 200,
- "min_length": 1,
- },
- ("query",): {
- "max_length": 300,
- "min_length": 1,
- },
- ("group_name",): {
- "max_length": 100,
- "min_length": 1,
- },
- ("confidence_threshold",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- ("patience_time",): {
- "inclusive_maximum": 3600,
- "inclusive_minimum": 0,
- },
- ("pipeline_config",): {
- "max_length": 100,
- },
- ("metadata",): {
- "max_length": 1362,
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "name": (str,), # noqa: E501
- "query": (str,), # noqa: E501
- "group_name": (str,), # noqa: E501
- "confidence_threshold": (float,), # noqa: E501
- "patience_time": (float,), # noqa: E501
- "pipeline_config": (
- str,
- none_type,
- ), # noqa: E501
- "metadata": (str,), # noqa: E501
- "mode": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "mode_configuration": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "name": "name", # noqa: E501
- "query": "query", # noqa: E501
- "group_name": "group_name", # noqa: E501
- "confidence_threshold": "confidence_threshold", # noqa: E501
- "patience_time": "patience_time", # noqa: E501
- "pipeline_config": "pipeline_config", # noqa: E501
- "metadata": "metadata", # noqa: E501
- "mode": "mode", # noqa: E501
- "mode_configuration": "mode_configuration", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, name, query, *args, **kwargs): # noqa: E501
- """DetectorCreationInputRequest - a model defined in OpenAPI
-
- Args:
- name (str): A short, descriptive name for the detector.
- query (str): A question about the image.
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- group_name (str): Which group should this detector be part of?. [optional] # noqa: E501
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- pipeline_config (str, none_type): (Advanced usage) Configuration needed to instantiate a prediction pipeline.. [optional] # noqa: E501
- metadata (str): Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding.. [optional] # noqa: E501
- mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX. [optional] # noqa: E501
- mode_configuration (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- self.query = query
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, name, query, *args, **kwargs): # noqa: E501
- """DetectorCreationInputRequest - a model defined in OpenAPI
-
- Args:
- name (str): A short, descriptive name for the detector.
- query (str): A question about the image.
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- group_name (str): Which group should this detector be part of?. [optional] # noqa: E501
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- pipeline_config (str, none_type): (Advanced usage) Configuration needed to instantiate a prediction pipeline.. [optional] # noqa: E501
- metadata (str): Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding.. [optional] # noqa: E501
- mode (bool, date, datetime, dict, float, int, list, str, none_type): Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX. [optional] # noqa: E501
- mode_configuration (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- self.query = query
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/detector_group.py b/generated/groundlight_openapi_client/model/detector_group.py
deleted file mode 100644
index 5620b0c9..00000000
--- a/generated/groundlight_openapi_client/model/detector_group.py
+++ /dev/null
@@ -1,283 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class DetectorGroup(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 100,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "id": (str,), # noqa: E501
- "name": (str,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "id": "id", # noqa: E501
- "name": "name", # noqa: E501
- }
-
- read_only_vars = {
- "id", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, id, name, *args, **kwargs): # noqa: E501
- """DetectorGroup - a model defined in OpenAPI
-
- Args:
- id (str):
- name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.id = id
- self.name = name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, name, *args, **kwargs): # noqa: E501
- """DetectorGroup - a model defined in OpenAPI
-
- name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/detector_group_request.py b/generated/groundlight_openapi_client/model/detector_group_request.py
deleted file mode 100644
index 3302860f..00000000
--- a/generated/groundlight_openapi_client/model/detector_group_request.py
+++ /dev/null
@@ -1,279 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class DetectorGroupRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 100,
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "name": (str,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "name": "name", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501
- """DetectorGroupRequest - a model defined in OpenAPI
-
- Args:
- name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, name, *args, **kwargs): # noqa: E501
- """DetectorGroupRequest - a model defined in OpenAPI
-
- Args:
- name (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/detector_request.py b/generated/groundlight_openapi_client/model/detector_request.py
deleted file mode 100644
index c7f708f1..00000000
--- a/generated/groundlight_openapi_client/model/detector_request.py
+++ /dev/null
@@ -1,335 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.15.3
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.blank_enum import BlankEnum
- from groundlight_openapi_client.model.escalation_type_enum import EscalationTypeEnum
- from groundlight_openapi_client.model.status_enum import StatusEnum
-
- globals()["BlankEnum"] = BlankEnum
- globals()["EscalationTypeEnum"] = EscalationTypeEnum
- globals()["StatusEnum"] = StatusEnum
-
-
-class DetectorRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 200,
- "min_length": 1,
- },
- ("confidence_threshold",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- ("patience_time",): {
- "inclusive_maximum": 3600,
- "inclusive_minimum": 0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "name": (str,), # noqa: E501
- "confidence_threshold": (float,), # noqa: E501
- "patience_time": (float,), # noqa: E501
- "status": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "escalation_type": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "name": "name", # noqa: E501
- "confidence_threshold": "confidence_threshold", # noqa: E501
- "patience_time": "patience_time", # noqa: E501
- "status": "status", # noqa: E501
- "escalation_type": "escalation_type", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, name, *args, **kwargs): # noqa: E501
- """DetectorRequest - a model defined in OpenAPI
-
- Args:
- name (str): A short, descriptive name for the detector.
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, name, *args, **kwargs): # noqa: E501
- """DetectorRequest - a model defined in OpenAPI
-
- Args:
- name (str): A short, descriptive name for the detector.
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- escalation_type (bool, date, datetime, dict, float, int, list, str, none_type): Category that define internal proccess for labeling image queries * `STANDARD` - STANDARD * `NO_HUMAN_LABELING` - NO_HUMAN_LABELING. [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/detector_type_enum.py b/generated/groundlight_openapi_client/model/detector_type_enum.py
deleted file mode 100644
index 94d446da..00000000
--- a/generated/groundlight_openapi_client/model/detector_type_enum.py
+++ /dev/null
@@ -1,274 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class DetectorTypeEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "DETECTOR": "detector",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """DetectorTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): if omitted defaults to "detector", must be one of ["detector", ] # noqa: E501
-
- Keyword Args:
- value (str): if omitted defaults to "detector", must be one of ["detector", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- value = "detector"
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """DetectorTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): if omitted defaults to "detector", must be one of ["detector", ] # noqa: E501
-
- Keyword Args:
- value (str): if omitted defaults to "detector", must be one of ["detector", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- value = "detector"
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/edge_model_info.py b/generated/groundlight_openapi_client/model/edge_model_info.py
deleted file mode 100644
index 66826368..00000000
--- a/generated/groundlight_openapi_client/model/edge_model_info.py
+++ /dev/null
@@ -1,322 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class EdgeModelInfo(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "model_binary_id": (str,), # noqa: E501
- "model_binary_url": (str,), # noqa: E501
- "oodd_model_binary_id": (str,), # noqa: E501
- "oodd_model_binary_url": (str,), # noqa: E501
- "pipeline_config": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "oodd_pipeline_config": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "predictor_metadata": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "model_binary_id": "model_binary_id", # noqa: E501
- "model_binary_url": "model_binary_url", # noqa: E501
- "oodd_model_binary_id": "oodd_model_binary_id", # noqa: E501
- "oodd_model_binary_url": "oodd_model_binary_url", # noqa: E501
- "pipeline_config": "pipeline_config", # noqa: E501
- "oodd_pipeline_config": "oodd_pipeline_config", # noqa: E501
- "predictor_metadata": "predictor_metadata", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """EdgeModelInfo - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- model_binary_id (str): [optional] # noqa: E501
- model_binary_url (str): [optional] # noqa: E501
- oodd_model_binary_id (str): [optional] # noqa: E501
- oodd_model_binary_url (str): [optional] # noqa: E501
- pipeline_config (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- oodd_pipeline_config (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- predictor_metadata (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """EdgeModelInfo - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- model_binary_id (str): [optional] # noqa: E501
- model_binary_url (str): [optional] # noqa: E501
- oodd_model_binary_id (str): [optional] # noqa: E501
- oodd_model_binary_url (str): [optional] # noqa: E501
- pipeline_config (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- oodd_pipeline_config (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- predictor_metadata (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/escalation_type_enum.py b/generated/groundlight_openapi_client/model/escalation_type_enum.py
deleted file mode 100644
index 2b80360e..00000000
--- a/generated/groundlight_openapi_client/model/escalation_type_enum.py
+++ /dev/null
@@ -1,283 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class EscalationTypeEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "STANDARD": "STANDARD",
- "NO_HUMAN_LABELING": "NO_HUMAN_LABELING",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """EscalationTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """EscalationTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["STANDARD", "NO_HUMAN_LABELING", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/image_query.py b/generated/groundlight_openapi_client/model/image_query.py
deleted file mode 100644
index 79cf0179..00000000
--- a/generated/groundlight_openapi_client/model/image_query.py
+++ /dev/null
@@ -1,409 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.binary_classification_result import BinaryClassificationResult
- from groundlight_openapi_client.model.bounding_box_result import BoundingBoxResult
- from groundlight_openapi_client.model.counting_result import CountingResult
- from groundlight_openapi_client.model.image_query_type_enum import ImageQueryTypeEnum
- from groundlight_openapi_client.model.multi_classification_result import MultiClassificationResult
- from groundlight_openapi_client.model.result_type_enum import ResultTypeEnum
- from groundlight_openapi_client.model.roi import ROI
- from groundlight_openapi_client.model.text_recognition_result import TextRecognitionResult
-
- globals()["BinaryClassificationResult"] = BinaryClassificationResult
- globals()["BoundingBoxResult"] = BoundingBoxResult
- globals()["CountingResult"] = CountingResult
- globals()["ImageQueryTypeEnum"] = ImageQueryTypeEnum
- globals()["MultiClassificationResult"] = MultiClassificationResult
- globals()["ROI"] = ROI
- globals()["ResultTypeEnum"] = ResultTypeEnum
- globals()["TextRecognitionResult"] = TextRecognitionResult
-
-
-class ImageQuery(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "metadata": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "id": (str,), # noqa: E501
- "type": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "created_at": (datetime,), # noqa: E501
- "query": (str,), # noqa: E501
- "detector_id": (str,), # noqa: E501
- "result_type": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "result": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "patience_time": (float,), # noqa: E501
- "confidence_threshold": (float,), # noqa: E501
- "rois": (
- [ROI],
- none_type,
- ), # noqa: E501
- "text": (
- str,
- none_type,
- ), # noqa: E501
- "done_processing": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "metadata": "metadata", # noqa: E501
- "id": "id", # noqa: E501
- "type": "type", # noqa: E501
- "created_at": "created_at", # noqa: E501
- "query": "query", # noqa: E501
- "detector_id": "detector_id", # noqa: E501
- "result_type": "result_type", # noqa: E501
- "result": "result", # noqa: E501
- "patience_time": "patience_time", # noqa: E501
- "confidence_threshold": "confidence_threshold", # noqa: E501
- "rois": "rois", # noqa: E501
- "text": "text", # noqa: E501
- "done_processing": "done_processing", # noqa: E501
- }
-
- read_only_vars = {
- "metadata", # noqa: E501
- "id", # noqa: E501
- "type", # noqa: E501
- "created_at", # noqa: E501
- "query", # noqa: E501
- "detector_id", # noqa: E501
- "result_type", # noqa: E501
- "patience_time", # noqa: E501
- "confidence_threshold", # noqa: E501
- "rois", # noqa: E501
- "text", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(
- cls,
- metadata,
- id,
- type,
- created_at,
- query,
- detector_id,
- result_type,
- result,
- patience_time,
- confidence_threshold,
- rois,
- text,
- *args,
- **kwargs,
- ): # noqa: E501
- """ImageQuery - a model defined in OpenAPI
-
- Args:
- metadata ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): Metadata about the image query.
- id (str): A unique ID for this object.
- type (bool, date, datetime, dict, float, int, list, str, none_type): The type of this object.
- created_at (datetime): When was this detector created?
- query (str): A question about the image.
- detector_id (str): Which detector was used on this image query?
- result_type (bool, date, datetime, dict, float, int, list, str, none_type): What type of result are we returning?
- result (bool, date, datetime, dict, float, int, list, str, none_type):
- patience_time (float): How long to wait for a confident response.
- confidence_threshold (float): Min confidence needed to accept the response of the image query.
- rois ([ROI], none_type): An array of regions of interest (bounding boxes) collected on image
- text (str, none_type): A text field on image query.
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- done_processing (bool): EDGE ONLY - Whether the image query has completed escalating and will receive no new results.. [optional] if omitted the server will use the default value of False # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.metadata = metadata
- self.id = id
- self.type = type
- self.created_at = created_at
- self.query = query
- self.detector_id = detector_id
- self.result_type = result_type
- self.result = result
- self.patience_time = patience_time
- self.confidence_threshold = confidence_threshold
- self.rois = rois
- self.text = text
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, result, *args, **kwargs): # noqa: E501
- """ImageQuery - a model defined in OpenAPI
-
- result (bool, date, datetime, dict, float, int, list, str, none_type):
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- done_processing (bool): EDGE ONLY - Whether the image query has completed escalating and will receive no new results.. [optional] if omitted the server will use the default value of False # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.result = result
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/image_query_type_enum.py b/generated/groundlight_openapi_client/model/image_query_type_enum.py
deleted file mode 100644
index 42470730..00000000
--- a/generated/groundlight_openapi_client/model/image_query_type_enum.py
+++ /dev/null
@@ -1,274 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class ImageQueryTypeEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "IMAGE_QUERY": "image_query",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """ImageQueryTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): if omitted defaults to "image_query", must be one of ["image_query", ] # noqa: E501
-
- Keyword Args:
- value (str): if omitted defaults to "image_query", must be one of ["image_query", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- value = "image_query"
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """ImageQueryTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): if omitted defaults to "image_query", must be one of ["image_query", ] # noqa: E501
-
- Keyword Args:
- value (str): if omitted defaults to "image_query", must be one of ["image_query", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- value = "image_query"
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/inline_response200.py b/generated/groundlight_openapi_client/model/inline_response200.py
deleted file mode 100644
index 62e2494f..00000000
--- a/generated/groundlight_openapi_client/model/inline_response200.py
+++ /dev/null
@@ -1,276 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.inline_response200_summary import InlineResponse200Summary
-
- globals()["InlineResponse200Summary"] = InlineResponse200Summary
-
-
-class InlineResponse200(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "summary": (InlineResponse200Summary,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "summary": "summary", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """InlineResponse200 - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- summary (InlineResponse200Summary): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """InlineResponse200 - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- summary (InlineResponse200Summary): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/inline_response2001.py b/generated/groundlight_openapi_client/model/inline_response2001.py
deleted file mode 100644
index cdb30032..00000000
--- a/generated/groundlight_openapi_client/model/inline_response2001.py
+++ /dev/null
@@ -1,278 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.inline_response2001_evaluation_results import (
- InlineResponse2001EvaluationResults,
- )
-
- globals()["InlineResponse2001EvaluationResults"] = InlineResponse2001EvaluationResults
-
-
-class InlineResponse2001(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "evaluation_results": (InlineResponse2001EvaluationResults,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "evaluation_results": "evaluation_results", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """InlineResponse2001 - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- evaluation_results (InlineResponse2001EvaluationResults): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """InlineResponse2001 - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- evaluation_results (InlineResponse2001EvaluationResults): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py b/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py
deleted file mode 100644
index 9ee33a84..00000000
--- a/generated/groundlight_openapi_client/model/inline_response2001_evaluation_results.py
+++ /dev/null
@@ -1,391 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class InlineResponse2001EvaluationResults(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = True
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "eval_timestamp": (datetime,), # noqa: E501
- "total_ground_truth_examples": (
- int,
- none_type,
- ), # noqa: E501
- "total_labeled_examples": (
- int,
- none_type,
- ), # noqa: E501
- "kfold_pooled__balanced_accuracy": (float,), # noqa: E501
- "kfold_pooled__positive_accuracy": (
- float,
- none_type,
- ), # noqa: E501
- "kfold_pooled__negative_accuracy": (
- float,
- none_type,
- ), # noqa: E501
- "precision__mean": (
- float,
- none_type,
- ), # noqa: E501
- "recall__mean": (
- float,
- none_type,
- ), # noqa: E501
- "roc_auc__mean": (
- float,
- none_type,
- ), # noqa: E501
- "balanced_system_accuracies": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "positive_system_accuracies": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "negative_system_accuracies": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "mean_absolute_error__mean": (
- float,
- none_type,
- ), # noqa: E501
- "objdet_precision__mean": (
- float,
- none_type,
- ), # noqa: E501
- "objdet_recall__mean": (
- float,
- none_type,
- ), # noqa: E501
- "objdet_f1_score__mean": (
- float,
- none_type,
- ), # noqa: E501
- "class_accuracies": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "confusion_dict": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- "num_examples_per_class": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "eval_timestamp": "eval_timestamp", # noqa: E501
- "total_ground_truth_examples": "total_ground_truth_examples", # noqa: E501
- "total_labeled_examples": "total_labeled_examples", # noqa: E501
- "kfold_pooled__balanced_accuracy": "kfold_pooled__balanced_accuracy", # noqa: E501
- "kfold_pooled__positive_accuracy": "kfold_pooled__positive_accuracy", # noqa: E501
- "kfold_pooled__negative_accuracy": "kfold_pooled__negative_accuracy", # noqa: E501
- "precision__mean": "precision__mean", # noqa: E501
- "recall__mean": "recall__mean", # noqa: E501
- "roc_auc__mean": "roc_auc__mean", # noqa: E501
- "balanced_system_accuracies": "balanced_system_accuracies", # noqa: E501
- "positive_system_accuracies": "positive_system_accuracies", # noqa: E501
- "negative_system_accuracies": "negative_system_accuracies", # noqa: E501
- "mean_absolute_error__mean": "mean_absolute_error__mean", # noqa: E501
- "objdet_precision__mean": "objdet_precision__mean", # noqa: E501
- "objdet_recall__mean": "objdet_recall__mean", # noqa: E501
- "objdet_f1_score__mean": "objdet_f1_score__mean", # noqa: E501
- "class_accuracies": "class_accuracies", # noqa: E501
- "confusion_dict": "confusion_dict", # noqa: E501
- "num_examples_per_class": "num_examples_per_class", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """InlineResponse2001EvaluationResults - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- eval_timestamp (datetime): [optional] # noqa: E501
- total_ground_truth_examples (int, none_type): [optional] # noqa: E501
- total_labeled_examples (int, none_type): [optional] # noqa: E501
- kfold_pooled__balanced_accuracy (float): [optional] # noqa: E501
- kfold_pooled__positive_accuracy (float, none_type): [optional] # noqa: E501
- kfold_pooled__negative_accuracy (float, none_type): [optional] # noqa: E501
- precision__mean (float, none_type): [optional] # noqa: E501
- recall__mean (float, none_type): [optional] # noqa: E501
- roc_auc__mean (float, none_type): [optional] # noqa: E501
- balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- mean_absolute_error__mean (float, none_type): [optional] # noqa: E501
- objdet_precision__mean (float, none_type): [optional] # noqa: E501
- objdet_recall__mean (float, none_type): [optional] # noqa: E501
- objdet_f1_score__mean (float, none_type): [optional] # noqa: E501
- class_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- confusion_dict ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- num_examples_per_class ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """InlineResponse2001EvaluationResults - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- eval_timestamp (datetime): [optional] # noqa: E501
- total_ground_truth_examples (int, none_type): [optional] # noqa: E501
- total_labeled_examples (int, none_type): [optional] # noqa: E501
- kfold_pooled__balanced_accuracy (float): [optional] # noqa: E501
- kfold_pooled__positive_accuracy (float, none_type): [optional] # noqa: E501
- kfold_pooled__negative_accuracy (float, none_type): [optional] # noqa: E501
- precision__mean (float, none_type): [optional] # noqa: E501
- recall__mean (float, none_type): [optional] # noqa: E501
- roc_auc__mean (float, none_type): [optional] # noqa: E501
- balanced_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- positive_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- negative_system_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- mean_absolute_error__mean (float, none_type): [optional] # noqa: E501
- objdet_precision__mean (float, none_type): [optional] # noqa: E501
- objdet_recall__mean (float, none_type): [optional] # noqa: E501
- objdet_f1_score__mean (float, none_type): [optional] # noqa: E501
- class_accuracies ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- confusion_dict ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- num_examples_per_class ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/inline_response2002.py b/generated/groundlight_openapi_client/model/inline_response2002.py
deleted file mode 100644
index 1fbfd51d..00000000
--- a/generated/groundlight_openapi_client/model/inline_response2002.py
+++ /dev/null
@@ -1,268 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class InlineResponse2002(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "username": (str,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "username": "username", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """InlineResponse2002 - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- username (str): The user's username. [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """InlineResponse2002 - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- username (str): The user's username. [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/inline_response200_summary.py b/generated/groundlight_openapi_client/model/inline_response200_summary.py
deleted file mode 100644
index d5c30a12..00000000
--- a/generated/groundlight_openapi_client/model/inline_response200_summary.py
+++ /dev/null
@@ -1,296 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.inline_response200_summary_class_counts import (
- InlineResponse200SummaryClassCounts,
- )
-
- globals()["InlineResponse200SummaryClassCounts"] = InlineResponse200SummaryClassCounts
-
-
-class InlineResponse200Summary(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = True
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "num_ground_truth": (int,), # noqa: E501
- "num_current_source_human": (int,), # noqa: E501
- "class_counts": (InlineResponse200SummaryClassCounts,), # noqa: E501
- "unconfident_counts": (
- {str: (bool, date, datetime, dict, float, int, list, str, none_type)},
- ), # noqa: E501
- "total_iqs": (int,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "num_ground_truth": "num_ground_truth", # noqa: E501
- "num_current_source_human": "num_current_source_human", # noqa: E501
- "class_counts": "class_counts", # noqa: E501
- "unconfident_counts": "unconfident_counts", # noqa: E501
- "total_iqs": "total_iqs", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """InlineResponse200Summary - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- num_ground_truth (int): [optional] # noqa: E501
- num_current_source_human (int): [optional] # noqa: E501
- class_counts (InlineResponse200SummaryClassCounts): [optional] # noqa: E501
- unconfident_counts ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- total_iqs (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """InlineResponse200Summary - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- num_ground_truth (int): [optional] # noqa: E501
- num_current_source_human (int): [optional] # noqa: E501
- class_counts (InlineResponse200SummaryClassCounts): [optional] # noqa: E501
- unconfident_counts ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- total_iqs (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/inline_response200_summary_class_counts.py b/generated/groundlight_openapi_client/model/inline_response200_summary_class_counts.py
deleted file mode 100644
index b2eb180b..00000000
--- a/generated/groundlight_openapi_client/model/inline_response200_summary_class_counts.py
+++ /dev/null
@@ -1,284 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class InlineResponse200SummaryClassCounts(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "source_ml": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
- "source_human": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
- "cloud_labeler": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
- "cloud": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
- "total": ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "source_ml": "source_ml", # noqa: E501
- "source_human": "source_human", # noqa: E501
- "cloud_labeler": "cloud_labeler", # noqa: E501
- "cloud": "cloud", # noqa: E501
- "total": "total", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """InlineResponse200SummaryClassCounts - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- source_ml ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- source_human ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- cloud_labeler ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- cloud ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- total ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """InlineResponse200SummaryClassCounts - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- source_ml ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- source_human ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- cloud_labeler ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- cloud ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- total ({str: (bool, date, datetime, dict, float, int, list, str, none_type)}): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/label.py b/generated/groundlight_openapi_client/model/label.py
deleted file mode 100644
index 810b9e2e..00000000
--- a/generated/groundlight_openapi_client/model/label.py
+++ /dev/null
@@ -1,284 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class Label(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "YES": "YES",
- "NO": "NO",
- "UNCLEAR": "UNCLEAR",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """Label - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """Label - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["YES", "NO", "UNCLEAR", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/label_value.py b/generated/groundlight_openapi_client/model/label_value.py
deleted file mode 100644
index ee9b73e9..00000000
--- a/generated/groundlight_openapi_client/model/label_value.py
+++ /dev/null
@@ -1,331 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.roi import ROI
-
- globals()["ROI"] = ROI
-
-
-class LabelValue(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "confidence": (
- float,
- none_type,
- ), # noqa: E501
- "class_name": (
- str,
- none_type,
- ), # noqa: E501
- "annotations_requested": ([str],), # noqa: E501
- "created_at": (datetime,), # noqa: E501
- "detector_id": (
- int,
- none_type,
- ), # noqa: E501
- "source": (str,), # noqa: E501
- "text": (
- str,
- none_type,
- ), # noqa: E501
- "rois": (
- [ROI],
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "confidence": "confidence", # noqa: E501
- "class_name": "class_name", # noqa: E501
- "annotations_requested": "annotations_requested", # noqa: E501
- "created_at": "created_at", # noqa: E501
- "detector_id": "detector_id", # noqa: E501
- "source": "source", # noqa: E501
- "text": "text", # noqa: E501
- "rois": "rois", # noqa: E501
- }
-
- read_only_vars = {
- "confidence", # noqa: E501
- "class_name", # noqa: E501
- "annotations_requested", # noqa: E501
- "created_at", # noqa: E501
- "detector_id", # noqa: E501
- "source", # noqa: E501
- "text", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(
- cls, confidence, class_name, annotations_requested, created_at, detector_id, source, text, *args, **kwargs
- ): # noqa: E501
- """LabelValue - a model defined in OpenAPI
-
- Args:
- confidence (float, none_type):
- class_name (str, none_type): Return a human-readable class name for this label (e.g. YES/NO)
- annotations_requested ([str]):
- created_at (datetime):
- detector_id (int, none_type):
- source (str):
- text (str, none_type): Text annotations
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- rois ([ROI], none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.confidence = confidence
- self.class_name = class_name
- self.annotations_requested = annotations_requested
- self.created_at = created_at
- self.detector_id = detector_id
- self.source = source
- self.text = text
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """LabelValue - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- rois ([ROI], none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/label_value_request.py b/generated/groundlight_openapi_client/model/label_value_request.py
deleted file mode 100644
index 434f8ad8..00000000
--- a/generated/groundlight_openapi_client/model/label_value_request.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.roi_request import ROIRequest
-
- globals()["ROIRequest"] = ROIRequest
-
-
-class LabelValueRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("image_query_id",): {
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "label": (
- str,
- none_type,
- ), # noqa: E501
- "image_query_id": (str,), # noqa: E501
- "rois": (
- [ROIRequest],
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "label": "label", # noqa: E501
- "image_query_id": "image_query_id", # noqa: E501
- "rois": "rois", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, label, image_query_id, *args, **kwargs): # noqa: E501
- """LabelValueRequest - a model defined in OpenAPI
-
- Args:
- label (str, none_type):
- image_query_id (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- rois ([ROIRequest], none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- self.image_query_id = image_query_id
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, label, image_query_id, *args, **kwargs): # noqa: E501
- """LabelValueRequest - a model defined in OpenAPI
-
- Args:
- label (str, none_type):
- image_query_id (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- rois ([ROIRequest], none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- self.image_query_id = image_query_id
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/mode_enum.py b/generated/groundlight_openapi_client/model/mode_enum.py
deleted file mode 100644
index b35a3833..00000000
--- a/generated/groundlight_openapi_client/model/mode_enum.py
+++ /dev/null
@@ -1,286 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class ModeEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "BINARY": "BINARY",
- "COUNT": "COUNT",
- "MULTI_CLASS": "MULTI_CLASS",
- "TEXT": "TEXT",
- "BOUNDING_BOX": "BOUNDING_BOX",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """ModeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """ModeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/multi_class_mode_configuration.py b/generated/groundlight_openapi_client/model/multi_class_mode_configuration.py
deleted file mode 100644
index f08ee27c..00000000
--- a/generated/groundlight_openapi_client/model/multi_class_mode_configuration.py
+++ /dev/null
@@ -1,278 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class MultiClassModeConfiguration(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "class_names": ([str],), # noqa: E501
- "num_classes": (int,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "class_names": "class_names", # noqa: E501
- "num_classes": "num_classes", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, class_names, *args, **kwargs): # noqa: E501
- """MultiClassModeConfiguration - a model defined in OpenAPI
-
- Args:
- class_names ([str]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- num_classes (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.class_names = class_names
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, class_names, *args, **kwargs): # noqa: E501
- """MultiClassModeConfiguration - a model defined in OpenAPI
-
- Args:
- class_names ([str]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- num_classes (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.class_names = class_names
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/multi_class_mode_configuration_serializer.py b/generated/groundlight_openapi_client/model/multi_class_mode_configuration_serializer.py
deleted file mode 100644
index 22241510..00000000
--- a/generated/groundlight_openapi_client/model/multi_class_mode_configuration_serializer.py
+++ /dev/null
@@ -1,280 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.15.3
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class MultiClassModeConfigurationSerializer(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "id": (str,), # noqa: E501
- "num_classes": (int,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "id": "id", # noqa: E501
- "num_classes": "num_classes", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, id, num_classes, *args, **kwargs): # noqa: E501
- """MultiClassModeConfigurationSerializer - a model defined in OpenAPI
-
- Args:
- id (str):
- num_classes (int):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.id = id
- self.num_classes = num_classes
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, id, num_classes, *args, **kwargs): # noqa: E501
- """MultiClassModeConfigurationSerializer - a model defined in OpenAPI
-
- Args:
- id (str):
- num_classes (int):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.id = id
- self.num_classes = num_classes
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/multi_classification_result.py b/generated/groundlight_openapi_client/model/multi_classification_result.py
deleted file mode 100644
index bfc778c5..00000000
--- a/generated/groundlight_openapi_client/model/multi_classification_result.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class MultiClassificationResult(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("result_type",): {
- "MULTI_CLASSIFICATION": "multi_classification",
- },
- }
-
- validations = {
- ("confidence",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "label": (str,), # noqa: E501
- "confidence": (
- float,
- none_type,
- ), # noqa: E501
- "source": (str,), # noqa: E501
- "result_type": (str,), # noqa: E501
- "from_edge": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "label": "label", # noqa: E501
- "confidence": "confidence", # noqa: E501
- "source": "source", # noqa: E501
- "result_type": "result_type", # noqa: E501
- "from_edge": "from_edge", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501
- """MultiClassificationResult - a model defined in OpenAPI
-
- Args:
- label (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "multi_classification" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, label, *args, **kwargs): # noqa: E501
- """MultiClassificationResult - a model defined in OpenAPI
-
- Args:
- label (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "multi_classification" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/note.py b/generated/groundlight_openapi_client/model/note.py
deleted file mode 100644
index 64f139a7..00000000
--- a/generated/groundlight_openapi_client/model/note.py
+++ /dev/null
@@ -1,286 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class Note(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "detector_id": (str,), # noqa: E501
- "content": (
- str,
- none_type,
- ), # noqa: E501
- "is_pinned": (
- bool,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "detector_id": "detector_id", # noqa: E501
- "content": "content", # noqa: E501
- "is_pinned": "is_pinned", # noqa: E501
- }
-
- read_only_vars = {
- "detector_id", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, detector_id, *args, **kwargs): # noqa: E501
- """Note - a model defined in OpenAPI
-
- Args:
- detector_id (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- content (str, none_type): Text content of the note.. [optional] # noqa: E501
- is_pinned (bool, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.detector_id = detector_id
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """Note - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- content (str, none_type): Text content of the note.. [optional] # noqa: E501
- is_pinned (bool, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/note_request.py b/generated/groundlight_openapi_client/model/note_request.py
deleted file mode 100644
index 95889010..00000000
--- a/generated/groundlight_openapi_client/model/note_request.py
+++ /dev/null
@@ -1,285 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class NoteRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "content": (
- str,
- none_type,
- ), # noqa: E501
- "is_pinned": (
- bool,
- none_type,
- ), # noqa: E501
- "image": (
- file_type,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "content": "content", # noqa: E501
- "is_pinned": "is_pinned", # noqa: E501
- "image": "image", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """NoteRequest - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- content (str, none_type): Text content of the note.. [optional] # noqa: E501
- is_pinned (bool, none_type): [optional] # noqa: E501
- image (file_type, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """NoteRequest - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- content (str, none_type): Text content of the note.. [optional] # noqa: E501
- is_pinned (bool, none_type): [optional] # noqa: E501
- image (file_type, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/paginated_detector_list.py b/generated/groundlight_openapi_client/model/paginated_detector_list.py
deleted file mode 100644
index 5972205e..00000000
--- a/generated/groundlight_openapi_client/model/paginated_detector_list.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.detector import Detector
-
- globals()["Detector"] = Detector
-
-
-class PaginatedDetectorList(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "count": (int,), # noqa: E501
- "results": ([Detector],), # noqa: E501
- "next": (
- str,
- none_type,
- ), # noqa: E501
- "previous": (
- str,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "count": "count", # noqa: E501
- "results": "results", # noqa: E501
- "next": "next", # noqa: E501
- "previous": "previous", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, count, results, *args, **kwargs): # noqa: E501
- """PaginatedDetectorList - a model defined in OpenAPI
-
- Args:
- count (int):
- results ([Detector]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- next (str, none_type): [optional] # noqa: E501
- previous (str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- self.results = results
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, count, results, *args, **kwargs): # noqa: E501
- """PaginatedDetectorList - a model defined in OpenAPI
-
- Args:
- count (int):
- results ([Detector]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- next (str, none_type): [optional] # noqa: E501
- previous (str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- self.results = results
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/paginated_image_query_list.py b/generated/groundlight_openapi_client/model/paginated_image_query_list.py
deleted file mode 100644
index 13dccab7..00000000
--- a/generated/groundlight_openapi_client/model/paginated_image_query_list.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.image_query import ImageQuery
-
- globals()["ImageQuery"] = ImageQuery
-
-
-class PaginatedImageQueryList(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "count": (int,), # noqa: E501
- "results": ([ImageQuery],), # noqa: E501
- "next": (
- str,
- none_type,
- ), # noqa: E501
- "previous": (
- str,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "count": "count", # noqa: E501
- "results": "results", # noqa: E501
- "next": "next", # noqa: E501
- "previous": "previous", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, count, results, *args, **kwargs): # noqa: E501
- """PaginatedImageQueryList - a model defined in OpenAPI
-
- Args:
- count (int):
- results ([ImageQuery]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- next (str, none_type): [optional] # noqa: E501
- previous (str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- self.results = results
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, count, results, *args, **kwargs): # noqa: E501
- """PaginatedImageQueryList - a model defined in OpenAPI
-
- Args:
- count (int):
- results ([ImageQuery]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- next (str, none_type): [optional] # noqa: E501
- previous (str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- self.results = results
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/paginated_rule_list.py b/generated/groundlight_openapi_client/model/paginated_rule_list.py
deleted file mode 100644
index 6d007e1d..00000000
--- a/generated/groundlight_openapi_client/model/paginated_rule_list.py
+++ /dev/null
@@ -1,302 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.rule import Rule
-
- globals()["Rule"] = Rule
-
-
-class PaginatedRuleList(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "count": (int,), # noqa: E501
- "results": ([Rule],), # noqa: E501
- "next": (
- str,
- none_type,
- ), # noqa: E501
- "previous": (
- str,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "count": "count", # noqa: E501
- "results": "results", # noqa: E501
- "next": "next", # noqa: E501
- "previous": "previous", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, count, results, *args, **kwargs): # noqa: E501
- """PaginatedRuleList - a model defined in OpenAPI
-
- Args:
- count (int):
- results ([Rule]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- next (str, none_type): [optional] # noqa: E501
- previous (str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- self.results = results
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, count, results, *args, **kwargs): # noqa: E501
- """PaginatedRuleList - a model defined in OpenAPI
-
- Args:
- count (int):
- results ([Rule]):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- next (str, none_type): [optional] # noqa: E501
- previous (str, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.count = count
- self.results = results
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/patched_detector_request.py b/generated/groundlight_openapi_client/model/patched_detector_request.py
deleted file mode 100644
index 7e7a5813..00000000
--- a/generated/groundlight_openapi_client/model/patched_detector_request.py
+++ /dev/null
@@ -1,320 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.blank_enum import BlankEnum
- from groundlight_openapi_client.model.status_enum import StatusEnum
-
- globals()["BlankEnum"] = BlankEnum
- globals()["StatusEnum"] = StatusEnum
-
-
-class PatchedDetectorRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 200,
- "min_length": 1,
- },
- ("confidence_threshold",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- ("patience_time",): {
- "inclusive_maximum": 3600,
- "inclusive_minimum": 0,
- },
- ("escalation_type",): {
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "name": (str,), # noqa: E501
- "confidence_threshold": (float,), # noqa: E501
- "patience_time": (float,), # noqa: E501
- "status": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "escalation_type": (str,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "name": "name", # noqa: E501
- "confidence_threshold": "confidence_threshold", # noqa: E501
- "patience_time": "patience_time", # noqa: E501
- "status": "status", # noqa: E501
- "escalation_type": "escalation_type", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """PatchedDetectorRequest - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- name (str): A short, descriptive name for the detector.. [optional] # noqa: E501
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- escalation_type (str): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """PatchedDetectorRequest - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- name (str): A short, descriptive name for the detector.. [optional] # noqa: E501
- confidence_threshold (float): If the detector's prediction is below this confidence threshold, send the image query for human review.. [optional] if omitted the server will use the default value of 0.9 # noqa: E501
- patience_time (float): How long Groundlight will attempt to generate a confident prediction. [optional] if omitted the server will use the default value of 30.0 # noqa: E501
- status (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- escalation_type (str): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/payload_template.py b/generated/groundlight_openapi_client/model/payload_template.py
deleted file mode 100644
index a721bb4c..00000000
--- a/generated/groundlight_openapi_client/model/payload_template.py
+++ /dev/null
@@ -1,281 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class PayloadTemplate(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "template": (str,), # noqa: E501
- "headers": (
- {str: (str,)},
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "template": "template", # noqa: E501
- "headers": "headers", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, template, *args, **kwargs): # noqa: E501
- """PayloadTemplate - a model defined in OpenAPI
-
- Args:
- template (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- headers ({str: (str,)}, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.template = template
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, template, *args, **kwargs): # noqa: E501
- """PayloadTemplate - a model defined in OpenAPI
-
- Args:
- template (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- headers ({str: (str,)}, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.template = template
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/payload_template_request.py b/generated/groundlight_openapi_client/model/payload_template_request.py
deleted file mode 100644
index 3a0f12a2..00000000
--- a/generated/groundlight_openapi_client/model/payload_template_request.py
+++ /dev/null
@@ -1,285 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class PayloadTemplateRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("template",): {
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "template": (str,), # noqa: E501
- "headers": (
- {str: (str,)},
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "template": "template", # noqa: E501
- "headers": "headers", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, template, *args, **kwargs): # noqa: E501
- """PayloadTemplateRequest - a model defined in OpenAPI
-
- Args:
- template (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- headers ({str: (str,)}, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.template = template
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, template, *args, **kwargs): # noqa: E501
- """PayloadTemplateRequest - a model defined in OpenAPI
-
- Args:
- template (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- headers ({str: (str,)}, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.template = template
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/result_type_enum.py b/generated/groundlight_openapi_client/model/result_type_enum.py
deleted file mode 100644
index c4b954fd..00000000
--- a/generated/groundlight_openapi_client/model/result_type_enum.py
+++ /dev/null
@@ -1,286 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class ResultTypeEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "BINARY_CLASSIFICATION": "binary_classification",
- "COUNTING": "counting",
- "MULTI_CLASSIFICATION": "multi_classification",
- "TEXT_RECOGNITION": "text_recognition",
- "BOUNDING_BOX": "bounding_box",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """ResultTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """ResultTypeEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/roi.py b/generated/groundlight_openapi_client/model/roi.py
deleted file mode 100644
index 74c4fc66..00000000
--- a/generated/groundlight_openapi_client/model/roi.py
+++ /dev/null
@@ -1,294 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.b_box_geometry import BBoxGeometry
-
- globals()["BBoxGeometry"] = BBoxGeometry
-
-
-class ROI(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {}
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "label": (str,), # noqa: E501
- "score": (float,), # noqa: E501
- "geometry": (BBoxGeometry,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "label": "label", # noqa: E501
- "score": "score", # noqa: E501
- "geometry": "geometry", # noqa: E501
- }
-
- read_only_vars = {
- "score", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, label, score, geometry, *args, **kwargs): # noqa: E501
- """ROI - a model defined in OpenAPI
-
- Args:
- label (str): The label of the bounding box.
- score (float): The confidence of the bounding box.
- geometry (BBoxGeometry):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- self.score = score
- self.geometry = geometry
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, label, geometry, *args, **kwargs): # noqa: E501
- """ROI - a model defined in OpenAPI
-
- Args:
- label (str): The label of the bounding box.
- geometry (BBoxGeometry):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- self.geometry = geometry
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/roi_request.py b/generated/groundlight_openapi_client/model/roi_request.py
deleted file mode 100644
index 07fb54e2..00000000
--- a/generated/groundlight_openapi_client/model/roi_request.py
+++ /dev/null
@@ -1,292 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.b_box_geometry_request import BBoxGeometryRequest
-
- globals()["BBoxGeometryRequest"] = BBoxGeometryRequest
-
-
-class ROIRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("label",): {
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "label": (str,), # noqa: E501
- "geometry": (BBoxGeometryRequest,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "label": "label", # noqa: E501
- "geometry": "geometry", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, label, geometry, *args, **kwargs): # noqa: E501
- """ROIRequest - a model defined in OpenAPI
-
- Args:
- label (str): The label of the bounding box.
- geometry (BBoxGeometryRequest):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- self.geometry = geometry
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, label, geometry, *args, **kwargs): # noqa: E501
- """ROIRequest - a model defined in OpenAPI
-
- Args:
- label (str): The label of the bounding box.
- geometry (BBoxGeometryRequest):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.label = label
- self.geometry = geometry
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/rule.py b/generated/groundlight_openapi_client/model/rule.py
deleted file mode 100644
index 7f1be14a..00000000
--- a/generated/groundlight_openapi_client/model/rule.py
+++ /dev/null
@@ -1,366 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.action import Action
- from groundlight_openapi_client.model.action_list import ActionList
- from groundlight_openapi_client.model.condition import Condition
- from groundlight_openapi_client.model.snooze_time_unit_enum import SnoozeTimeUnitEnum
- from groundlight_openapi_client.model.webhook_action import WebhookAction
-
- globals()["Action"] = Action
- globals()["ActionList"] = ActionList
- globals()["Condition"] = Condition
- globals()["SnoozeTimeUnitEnum"] = SnoozeTimeUnitEnum
- globals()["WebhookAction"] = WebhookAction
-
-
-class Rule(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 44,
- },
- ("snooze_time_value",): {
- "inclusive_minimum": 0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "id": (int,), # noqa: E501
- "detector_id": (str,), # noqa: E501
- "detector_name": (str,), # noqa: E501
- "name": (str,), # noqa: E501
- "condition": (Condition,), # noqa: E501
- "enabled": (bool,), # noqa: E501
- "snooze_time_enabled": (bool,), # noqa: E501
- "snooze_time_value": (int,), # noqa: E501
- "snooze_time_unit": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "human_review_required": (bool,), # noqa: E501
- "action": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "webhook_action": ([WebhookAction],), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "id": "id", # noqa: E501
- "detector_id": "detector_id", # noqa: E501
- "detector_name": "detector_name", # noqa: E501
- "name": "name", # noqa: E501
- "condition": "condition", # noqa: E501
- "enabled": "enabled", # noqa: E501
- "snooze_time_enabled": "snooze_time_enabled", # noqa: E501
- "snooze_time_value": "snooze_time_value", # noqa: E501
- "snooze_time_unit": "snooze_time_unit", # noqa: E501
- "human_review_required": "human_review_required", # noqa: E501
- "action": "action", # noqa: E501
- "webhook_action": "webhook_action", # noqa: E501
- }
-
- read_only_vars = {
- "id", # noqa: E501
- "detector_id", # noqa: E501
- "detector_name", # noqa: E501
- }
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, id, detector_id, detector_name, name, condition, *args, **kwargs): # noqa: E501
- """Rule - a model defined in OpenAPI
-
- Args:
- id (int):
- detector_id (str):
- detector_name (str):
- name (str):
- condition (Condition):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- enabled (bool): [optional] if omitted the server will use the default value of True # noqa: E501
- snooze_time_enabled (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501
- snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- webhook_action ([WebhookAction]): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.id = id
- self.detector_id = detector_id
- self.detector_name = detector_name
- self.name = name
- self.condition = condition
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, name, condition, *args, **kwargs): # noqa: E501
- """Rule - a model defined in OpenAPI
-
- name (str):
- condition (Condition):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- enabled (bool): [optional] if omitted the server will use the default value of True # noqa: E501
- snooze_time_enabled (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501
- snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- webhook_action ([WebhookAction]): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- self.condition = condition
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/rule_request.py b/generated/groundlight_openapi_client/model/rule_request.py
deleted file mode 100644
index 8fdf8fe1..00000000
--- a/generated/groundlight_openapi_client/model/rule_request.py
+++ /dev/null
@@ -1,352 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.action import Action
- from groundlight_openapi_client.model.action_list import ActionList
- from groundlight_openapi_client.model.condition_request import ConditionRequest
- from groundlight_openapi_client.model.snooze_time_unit_enum import SnoozeTimeUnitEnum
- from groundlight_openapi_client.model.webhook_action_request import WebhookActionRequest
-
- globals()["Action"] = Action
- globals()["ActionList"] = ActionList
- globals()["ConditionRequest"] = ConditionRequest
- globals()["SnoozeTimeUnitEnum"] = SnoozeTimeUnitEnum
- globals()["WebhookActionRequest"] = WebhookActionRequest
-
-
-class RuleRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("name",): {
- "max_length": 44,
- "min_length": 1,
- },
- ("snooze_time_value",): {
- "inclusive_minimum": 0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "name": (str,), # noqa: E501
- "condition": (ConditionRequest,), # noqa: E501
- "enabled": (bool,), # noqa: E501
- "snooze_time_enabled": (bool,), # noqa: E501
- "snooze_time_value": (int,), # noqa: E501
- "snooze_time_unit": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "human_review_required": (bool,), # noqa: E501
- "action": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "webhook_action": ([WebhookActionRequest],), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "name": "name", # noqa: E501
- "condition": "condition", # noqa: E501
- "enabled": "enabled", # noqa: E501
- "snooze_time_enabled": "snooze_time_enabled", # noqa: E501
- "snooze_time_value": "snooze_time_value", # noqa: E501
- "snooze_time_unit": "snooze_time_unit", # noqa: E501
- "human_review_required": "human_review_required", # noqa: E501
- "action": "action", # noqa: E501
- "webhook_action": "webhook_action", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, name, condition, *args, **kwargs): # noqa: E501
- """RuleRequest - a model defined in OpenAPI
-
- Args:
- name (str):
- condition (ConditionRequest):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- enabled (bool): [optional] if omitted the server will use the default value of True # noqa: E501
- snooze_time_enabled (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501
- snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- webhook_action ([WebhookActionRequest]): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- self.condition = condition
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, name, condition, *args, **kwargs): # noqa: E501
- """RuleRequest - a model defined in OpenAPI
-
- Args:
- name (str):
- condition (ConditionRequest):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- enabled (bool): [optional] if omitted the server will use the default value of True # noqa: E501
- snooze_time_enabled (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- snooze_time_value (int): [optional] if omitted the server will use the default value of 0 # noqa: E501
- snooze_time_unit (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- human_review_required (bool): [optional] if omitted the server will use the default value of False # noqa: E501
- action (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- webhook_action ([WebhookActionRequest]): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.name = name
- self.condition = condition
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/snooze_time_unit_enum.py b/generated/groundlight_openapi_client/model/snooze_time_unit_enum.py
deleted file mode 100644
index f5586bb6..00000000
--- a/generated/groundlight_openapi_client/model/snooze_time_unit_enum.py
+++ /dev/null
@@ -1,285 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class SnoozeTimeUnitEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "DAYS": "DAYS",
- "HOURS": "HOURS",
- "MINUTES": "MINUTES",
- "SECONDS": "SECONDS",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """SnoozeTimeUnitEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): * `DAYS` - DAYS * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS., must be one of ["DAYS", "HOURS", "MINUTES", "SECONDS", ] # noqa: E501
-
- Keyword Args:
- value (str): * `DAYS` - DAYS * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS., must be one of ["DAYS", "HOURS", "MINUTES", "SECONDS", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """SnoozeTimeUnitEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): * `DAYS` - DAYS * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS., must be one of ["DAYS", "HOURS", "MINUTES", "SECONDS", ] # noqa: E501
-
- Keyword Args:
- value (str): * `DAYS` - DAYS * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS., must be one of ["DAYS", "HOURS", "MINUTES", "SECONDS", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/source.py b/generated/groundlight_openapi_client/model/source.py
deleted file mode 100644
index 7e3e832a..00000000
--- a/generated/groundlight_openapi_client/model/source.py
+++ /dev/null
@@ -1,287 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class Source(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "STILL_PROCESSING": "STILL_PROCESSING",
- "CLOUD": "CLOUD",
- "USER": "USER",
- "CLOUD_ENSEMBLE": "CLOUD_ENSEMBLE",
- "ALGORITHM": "ALGORITHM",
- "EDGE": "EDGE",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """Source - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """Source - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["STILL_PROCESSING", "CLOUD", "USER", "CLOUD_ENSEMBLE", "ALGORITHM", "EDGE", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/source_enum.py b/generated/groundlight_openapi_client/model/source_enum.py
deleted file mode 100644
index 8a2746ab..00000000
--- a/generated/groundlight_openapi_client/model/source_enum.py
+++ /dev/null
@@ -1,289 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class SourceEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "INITIAL_PLACEHOLDER": "INITIAL_PLACEHOLDER",
- "CLOUD": "CLOUD",
- "CUST": "CUST",
- "HUMAN_CLOUD_ENSEMBLE": "HUMAN_CLOUD_ENSEMBLE",
- "ALG": "ALG",
- "ALG_REC": "ALG_REC",
- "ALG_UNCLEAR": "ALG_UNCLEAR",
- "EDGE": "EDGE",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """SourceEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """SourceEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["INITIAL_PLACEHOLDER", "CLOUD", "CUST", "HUMAN_CLOUD_ENSEMBLE", "ALG", "ALG_REC", "ALG_UNCLEAR", "EDGE", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/status_enum.py b/generated/groundlight_openapi_client/model/status_enum.py
deleted file mode 100644
index b41c2871..00000000
--- a/generated/groundlight_openapi_client/model/status_enum.py
+++ /dev/null
@@ -1,283 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class StatusEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "ON": "ON",
- "OFF": "OFF",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """StatusEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): * `ON` - ON * `OFF` - OFF., must be one of ["ON", "OFF", ] # noqa: E501
-
- Keyword Args:
- value (str): * `ON` - ON * `OFF` - OFF., must be one of ["ON", "OFF", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """StatusEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str): * `ON` - ON * `OFF` - OFF., must be one of ["ON", "OFF", ] # noqa: E501
-
- Keyword Args:
- value (str): * `ON` - ON * `OFF` - OFF., must be one of ["ON", "OFF", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/text_mode_configuration.py b/generated/groundlight_openapi_client/model/text_mode_configuration.py
deleted file mode 100644
index ee4c4e73..00000000
--- a/generated/groundlight_openapi_client/model/text_mode_configuration.py
+++ /dev/null
@@ -1,273 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class TextModeConfiguration(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("value_max_length",): {
- "inclusive_maximum": 250,
- "inclusive_minimum": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value_max_length": (int,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "value_max_length": "value_max_length", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
- """TextModeConfiguration - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- value_max_length (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs): # noqa: E501
- """TextModeConfiguration - a model defined in OpenAPI
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- value_max_length (int): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/text_recognition_result.py b/generated/groundlight_openapi_client/model/text_recognition_result.py
deleted file mode 100644
index 0e769567..00000000
--- a/generated/groundlight_openapi_client/model/text_recognition_result.py
+++ /dev/null
@@ -1,311 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class TextRecognitionResult(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("result_type",): {
- "TEXT_RECOGNITION": "text_recognition",
- },
- }
-
- validations = {
- ("confidence",): {
- "inclusive_maximum": 1.0,
- "inclusive_minimum": 0.0,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "text": (
- str,
- none_type,
- ), # noqa: E501
- "truncated": (bool,), # noqa: E501
- "confidence": (
- float,
- none_type,
- ), # noqa: E501
- "source": (str,), # noqa: E501
- "result_type": (str,), # noqa: E501
- "from_edge": (bool,), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "text": "text", # noqa: E501
- "truncated": "truncated", # noqa: E501
- "confidence": "confidence", # noqa: E501
- "source": "source", # noqa: E501
- "result_type": "result_type", # noqa: E501
- "from_edge": "from_edge", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, text, truncated, *args, **kwargs): # noqa: E501
- """TextRecognitionResult - a model defined in OpenAPI
-
- Args:
- text (str, none_type):
- truncated (bool):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "text_recognition" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.text = text
- self.truncated = truncated
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, text, truncated, *args, **kwargs): # noqa: E501
- """TextRecognitionResult - a model defined in OpenAPI
-
- Args:
- text (str, none_type):
- truncated (bool):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- confidence (float, none_type): [optional] # noqa: E501
- source (str): [optional] # noqa: E501
- result_type (str): [optional] if omitted the server will use the default value of "text_recognition" # noqa: E501
- from_edge (bool): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.text = text
- self.truncated = truncated
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/verb_enum.py b/generated/groundlight_openapi_client/model/verb_enum.py
deleted file mode 100644
index 789dd77c..00000000
--- a/generated/groundlight_openapi_client/model/verb_enum.py
+++ /dev/null
@@ -1,286 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-class VerbEnum(ModelSimple):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {
- ("value",): {
- "ANSWERED_CONSECUTIVELY": "ANSWERED_CONSECUTIVELY",
- "ANSWERED_WITHIN_TIME": "ANSWERED_WITHIN_TIME",
- "CHANGED_TO": "CHANGED_TO",
- "NO_CHANGE": "NO_CHANGE",
- "NO_QUERIES": "NO_QUERIES",
- },
- }
-
- validations = {}
-
- additional_properties_type = None
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- return {
- "value": (str,),
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {}
-
- read_only_vars = set()
-
- _composed_schemas = None
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, *args, **kwargs):
- """VerbEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, *args, **kwargs):
- """VerbEnum - a model defined in OpenAPI
-
- Note that value can be passed either in args or in kwargs, but not in both.
-
- Args:
- args[0] (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501
-
- Keyword Args:
- value (str):, must be one of ["ANSWERED_CONSECUTIVELY", "ANSWERED_WITHIN_TIME", "CHANGED_TO", "NO_CHANGE", "NO_QUERIES", ] # noqa: E501
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- """
- # required up here when default value is not given
- _path_to_item = kwargs.pop("_path_to_item", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if "value" in kwargs:
- value = kwargs.pop("value")
- elif args:
- args = list(args)
- value = args.pop(0)
- else:
- raise ApiTypeError(
- "value is required, but not passed in args or kwargs and doesn't have default",
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
- self.value = value
- if kwargs:
- raise ApiTypeError(
- "Invalid named arguments=%s passed to %s. Remove those invalid named arguments."
- % (
- kwargs,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- return self
diff --git a/generated/groundlight_openapi_client/model/webhook_action.py b/generated/groundlight_openapi_client/model/webhook_action.py
deleted file mode 100644
index 33f70f3c..00000000
--- a/generated/groundlight_openapi_client/model/webhook_action.py
+++ /dev/null
@@ -1,322 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.payload_template import PayloadTemplate
-
- globals()["PayloadTemplate"] = PayloadTemplate
-
-
-class WebhookAction(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("url",): {
- "max_length": 200,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "url": (str,), # noqa: E501
- "include_image": (bool,), # noqa: E501
- "payload_template": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "last_message_failed": (bool,), # noqa: E501
- "last_failure_error": (
- str,
- none_type,
- ), # noqa: E501
- "last_failed_at": (
- datetime,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "url": "url", # noqa: E501
- "include_image": "include_image", # noqa: E501
- "payload_template": "payload_template", # noqa: E501
- "last_message_failed": "last_message_failed", # noqa: E501
- "last_failure_error": "last_failure_error", # noqa: E501
- "last_failed_at": "last_failed_at", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501
- """WebhookAction - a model defined in OpenAPI
-
- Args:
- url (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- include_image (bool): [optional] # noqa: E501
- payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- last_message_failed (bool): [optional] # noqa: E501
- last_failure_error (str, none_type): [optional] # noqa: E501
- last_failed_at (datetime, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.url = url
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, url, *args, **kwargs): # noqa: E501
- """WebhookAction - a model defined in OpenAPI
-
- Args:
- url (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- include_image (bool): [optional] # noqa: E501
- payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- last_message_failed (bool): [optional] # noqa: E501
- last_failure_error (str, none_type): [optional] # noqa: E501
- last_failed_at (datetime, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.url = url
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model/webhook_action_request.py b/generated/groundlight_openapi_client/model/webhook_action_request.py
deleted file mode 100644
index cd98a99b..00000000
--- a/generated/groundlight_openapi_client/model/webhook_action_request.py
+++ /dev/null
@@ -1,323 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-import re # noqa: F401
-import sys # noqa: F401
-
-from groundlight_openapi_client.model_utils import ( # noqa: F401
- ApiTypeError,
- ModelComposed,
- ModelNormal,
- ModelSimple,
- cached_property,
- change_keys_js_to_python,
- convert_js_args_to_python_args,
- date,
- datetime,
- file_type,
- none_type,
- validate_get_composed_info,
- OpenApiModel,
-)
-from groundlight_openapi_client.exceptions import ApiAttributeError
-
-
-def lazy_import():
- from groundlight_openapi_client.model.payload_template_request import PayloadTemplateRequest
-
- globals()["PayloadTemplateRequest"] = PayloadTemplateRequest
-
-
-class WebhookActionRequest(ModelNormal):
- """NOTE: This class is auto generated by OpenAPI Generator.
- Ref: https://openapi-generator.tech
-
- Do not edit the class manually.
-
- Attributes:
- allowed_values (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- with a capitalized key describing the allowed value and an allowed
- value. These dicts store the allowed enum values.
- attribute_map (dict): The key is attribute name
- and the value is json key in definition.
- discriminator_value_class_map (dict): A dict to go from the discriminator
- variable value to the discriminator class name.
- validations (dict): The key is the tuple path to the attribute
- and the for var_name this is (var_name,). The value is a dict
- that stores validations for max_length, min_length, max_items,
- min_items, exclusive_maximum, inclusive_maximum, exclusive_minimum,
- inclusive_minimum, and regex.
- additional_properties_type (tuple): A tuple of classes accepted
- as additional properties values.
- """
-
- allowed_values = {}
-
- validations = {
- ("url",): {
- "max_length": 200,
- "min_length": 1,
- },
- }
-
- @cached_property
- def additional_properties_type():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
- """
- lazy_import()
- return (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ) # noqa: E501
-
- _nullable = False
-
- @cached_property
- def openapi_types():
- """
- This must be a method because a model may have properties that are
- of type self, this must run after the class is loaded
-
- Returns
- openapi_types (dict): The key is attribute name
- and the value is attribute type.
- """
- lazy_import()
- return {
- "url": (str,), # noqa: E501
- "include_image": (bool,), # noqa: E501
- "payload_template": (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ), # noqa: E501
- "last_message_failed": (bool,), # noqa: E501
- "last_failure_error": (
- str,
- none_type,
- ), # noqa: E501
- "last_failed_at": (
- datetime,
- none_type,
- ), # noqa: E501
- }
-
- @cached_property
- def discriminator():
- return None
-
- attribute_map = {
- "url": "url", # noqa: E501
- "include_image": "include_image", # noqa: E501
- "payload_template": "payload_template", # noqa: E501
- "last_message_failed": "last_message_failed", # noqa: E501
- "last_failure_error": "last_failure_error", # noqa: E501
- "last_failed_at": "last_failed_at", # noqa: E501
- }
-
- read_only_vars = {}
-
- _composed_schemas = {}
-
- @classmethod
- @convert_js_args_to_python_args
- def _from_openapi_data(cls, url, *args, **kwargs): # noqa: E501
- """WebhookActionRequest - a model defined in OpenAPI
-
- Args:
- url (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- include_image (bool): [optional] # noqa: E501
- payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- last_message_failed (bool): [optional] # noqa: E501
- last_failure_error (str, none_type): [optional] # noqa: E501
- last_failed_at (datetime, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- self = super(OpenApiModel, cls).__new__(cls)
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.url = url
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- return self
-
- required_properties = set([
- "_data_store",
- "_check_type",
- "_spec_property_naming",
- "_path_to_item",
- "_configuration",
- "_visited_composed_classes",
- ])
-
- @convert_js_args_to_python_args
- def __init__(self, url, *args, **kwargs): # noqa: E501
- """WebhookActionRequest - a model defined in OpenAPI
-
- Args:
- url (str):
-
- Keyword Args:
- _check_type (bool): if True, values for parameters in openapi_types
- will be type checked and a TypeError will be
- raised if the wrong type is input.
- Defaults to True
- _path_to_item (tuple/list): This is a list of keys or values to
- drill down to the model in received_data
- when deserializing a response
- _spec_property_naming (bool): True if the variable names in the input data
- are serialized names, as specified in the OpenAPI document.
- False if the variable names in the input data
- are pythonic names, e.g. snake case (default)
- _configuration (Configuration): the instance to use when
- deserializing a file_type parameter.
- If passed, type conversion is attempted
- If omitted no type conversion is done.
- _visited_composed_classes (tuple): This stores a tuple of
- classes that we have traveled through so that
- if we see that class again we will not use its
- discriminator again.
- When traveling through a discriminator, the
- composed schema that is
- is traveled through is added to this set.
- For example if Animal has a discriminator
- petType and we pass in "Dog", and the class Dog
- allOf includes Animal, we move through Animal
- once using the discriminator, and pick Dog.
- Then in Dog, we will make an instance of the
- Animal class but this time we won't travel
- through its discriminator because we passed in
- _visited_composed_classes = (Animal,)
- include_image (bool): [optional] # noqa: E501
- payload_template (bool, date, datetime, dict, float, int, list, str, none_type): [optional] # noqa: E501
- last_message_failed (bool): [optional] # noqa: E501
- last_failure_error (str, none_type): [optional] # noqa: E501
- last_failed_at (datetime, none_type): [optional] # noqa: E501
- """
-
- _check_type = kwargs.pop("_check_type", True)
- _spec_property_naming = kwargs.pop("_spec_property_naming", False)
- _path_to_item = kwargs.pop("_path_to_item", ())
- _configuration = kwargs.pop("_configuration", None)
- _visited_composed_classes = kwargs.pop("_visited_composed_classes", ())
-
- if args:
- raise ApiTypeError(
- "Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments."
- % (
- args,
- self.__class__.__name__,
- ),
- path_to_item=_path_to_item,
- valid_classes=(self.__class__,),
- )
-
- self._data_store = {}
- self._check_type = _check_type
- self._spec_property_naming = _spec_property_naming
- self._path_to_item = _path_to_item
- self._configuration = _configuration
- self._visited_composed_classes = _visited_composed_classes + (self.__class__,)
-
- self.url = url
- for var_name, var_value in kwargs.items():
- if (
- var_name not in self.attribute_map
- and self._configuration is not None
- and self._configuration.discard_unknown_keys
- and self.additional_properties_type is None
- ):
- # discard variable.
- continue
- setattr(self, var_name, var_value)
- if var_name in self.read_only_vars:
- raise ApiAttributeError(
- f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
- "class with read only attributes."
- )
diff --git a/generated/groundlight_openapi_client/model_utils.py b/generated/groundlight_openapi_client/model_utils.py
deleted file mode 100644
index cf7bd6d4..00000000
--- a/generated/groundlight_openapi_client/model_utils.py
+++ /dev/null
@@ -1,1932 +0,0 @@
-"""
- Groundlight API
-
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
-
- The version of the OpenAPI document: 0.18.2
- Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
-
-from datetime import date, datetime # noqa: F401
-from copy import deepcopy
-import inspect
-import io
-import os
-import pprint
-import re
-import tempfile
-
-from dateutil.parser import parse
-
-from groundlight_openapi_client.exceptions import (
- ApiKeyError,
- ApiAttributeError,
- ApiTypeError,
- ApiValueError,
-)
-
-none_type = type(None)
-file_type = io.IOBase
-
-
-def convert_js_args_to_python_args(fn):
- from functools import wraps
-
- @wraps(fn)
- def wrapped_init(_self, *args, **kwargs):
- """
- An attribute named `self` received from the api will conflicts with the reserved `self`
- parameter of a class method. During generation, `self` attributes are mapped
- to `_self` in models. Here, we name `_self` instead of `self` to avoid conflicts.
- """
- spec_property_naming = kwargs.get("_spec_property_naming", False)
- if spec_property_naming:
- kwargs = change_keys_js_to_python(kwargs, _self if isinstance(_self, type) else _self.__class__)
- return fn(_self, *args, **kwargs)
-
- return wrapped_init
-
-
-class cached_property(object):
- # this caches the result of the function call for fn with no inputs
- # use this as a decorator on function methods that you want converted
- # into cached properties
- result_key = "_results"
-
- def __init__(self, fn):
- self._fn = fn
-
- def __get__(self, instance, cls=None):
- if self.result_key in vars(self):
- return vars(self)[self.result_key]
- else:
- result = self._fn()
- setattr(self, self.result_key, result)
- return result
-
-
-PRIMITIVE_TYPES = (list, float, int, bool, datetime, date, str, file_type)
-
-
-def allows_single_value_input(cls):
- """
- This function returns True if the input composed schema model or any
- descendant model allows a value only input
- This is true for cases where oneOf contains items like:
- oneOf:
- - float
- - NumberWithValidation
- - StringEnum
- - ArrayModel
- - null
- TODO: lru_cache this
- """
- if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES:
- return True
- elif issubclass(cls, ModelComposed):
- if not cls._composed_schemas["oneOf"]:
- return False
- return any(allows_single_value_input(c) for c in cls._composed_schemas["oneOf"])
- return False
-
-
-def composed_model_input_classes(cls):
- """
- This function returns a list of the possible models that can be accepted as
- inputs.
- TODO: lru_cache this
- """
- if issubclass(cls, ModelSimple) or cls in PRIMITIVE_TYPES:
- return [cls]
- elif issubclass(cls, ModelNormal):
- if cls.discriminator is None:
- return [cls]
- else:
- return get_discriminated_classes(cls)
- elif issubclass(cls, ModelComposed):
- if not cls._composed_schemas["oneOf"]:
- return []
- if cls.discriminator is None:
- input_classes = []
- for c in cls._composed_schemas["oneOf"]:
- input_classes.extend(composed_model_input_classes(c))
- return input_classes
- else:
- return get_discriminated_classes(cls)
- return []
-
-
-class OpenApiModel(object):
- """The base class for all OpenAPIModels"""
-
- def set_attribute(self, name, value):
- # this is only used to set properties on self
-
- path_to_item = []
- if self._path_to_item:
- path_to_item.extend(self._path_to_item)
- path_to_item.append(name)
-
- if name in self.openapi_types:
- required_types_mixed = self.openapi_types[name]
- elif self.additional_properties_type is None:
- raise ApiAttributeError("{0} has no attribute '{1}'".format(type(self).__name__, name), path_to_item)
- elif self.additional_properties_type is not None:
- required_types_mixed = self.additional_properties_type
-
- if get_simple_class(name) != str:
- error_msg = type_error_message(var_name=name, var_value=name, valid_classes=(str,), key_type=True)
- raise ApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=(str,), key_type=True)
-
- if self._check_type:
- value = validate_and_convert_types(
- value,
- required_types_mixed,
- path_to_item,
- self._spec_property_naming,
- self._check_type,
- configuration=self._configuration,
- )
- if (name,) in self.allowed_values:
- check_allowed_values(self.allowed_values, (name,), value)
- if (name,) in self.validations:
- check_validations(self.validations, (name,), value, self._configuration)
- self.__dict__["_data_store"][name] = value
-
- def __repr__(self):
- """For `print` and `pprint`"""
- return self.to_str()
-
- def __ne__(self, other):
- """Returns true if both objects are not equal"""
- return not self == other
-
- def __setattr__(self, attr, value):
- """set the value of an attribute using dot notation: `instance.attr = val`"""
- self[attr] = value
-
- def __getattr__(self, attr):
- """get the value of an attribute using dot notation: `instance.attr`"""
- return self.__getitem__(attr)
-
- def __copy__(self):
- cls = self.__class__
- if self.get("_spec_property_naming", False):
- return cls._new_from_openapi_data(**self.__dict__)
- else:
- return new_cls.__new__(cls, **self.__dict__)
-
- def __deepcopy__(self, memo):
- cls = self.__class__
-
- if self.get("_spec_property_naming", False):
- new_inst = cls._new_from_openapi_data()
- else:
- new_inst = cls.__new__(cls)
-
- for k, v in self.__dict__.items():
- setattr(new_inst, k, deepcopy(v, memo))
- return new_inst
-
- def __new__(cls, *args, **kwargs):
- # this function uses the discriminator to
- # pick a new schema/class to instantiate because a discriminator
- # propertyName value was passed in
-
- if len(args) == 1:
- arg = args[0]
- if arg is None and is_type_nullable(cls):
- # The input data is the 'null' value and the type is nullable.
- return None
-
- if issubclass(cls, ModelComposed) and allows_single_value_input(cls):
- model_kwargs = {}
- oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg)
- return oneof_instance
-
- visited_composed_classes = kwargs.get("_visited_composed_classes", ())
- if cls.discriminator is None or cls in visited_composed_classes:
- # Use case 1: this openapi schema (cls) does not have a discriminator
- # Use case 2: we have already visited this class before and are sure that we
- # want to instantiate it this time. We have visited this class deserializing
- # a payload with a discriminator. During that process we traveled through
- # this class but did not make an instance of it. Now we are making an
- # instance of a composed class which contains cls in it, so this time make an instance of cls.
- #
- # Here's an example of use case 2: If Animal has a discriminator
- # petType and we pass in "Dog", and the class Dog
- # allOf includes Animal, we move through Animal
- # once using the discriminator, and pick Dog.
- # Then in the composed schema dog Dog, we will make an instance of the
- # Animal class (because Dal has allOf: Animal) but this time we won't travel
- # through Animal's discriminator because we passed in
- # _visited_composed_classes = (Animal,)
-
- return super(OpenApiModel, cls).__new__(cls)
-
- # Get the name and value of the discriminator property.
- # The discriminator name is obtained from the discriminator meta-data
- # and the discriminator value is obtained from the input data.
- discr_propertyname_py = list(cls.discriminator.keys())[0]
- discr_propertyname_js = cls.attribute_map[discr_propertyname_py]
- if discr_propertyname_js in kwargs:
- discr_value = kwargs[discr_propertyname_js]
- elif discr_propertyname_py in kwargs:
- discr_value = kwargs[discr_propertyname_py]
- else:
- # The input data does not contain the discriminator property.
- path_to_item = kwargs.get("_path_to_item", ())
- raise ApiValueError(
- "Cannot deserialize input data due to missing discriminator. "
- "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item)
- )
-
- # Implementation note: the last argument to get_discriminator_class
- # is a list of visited classes. get_discriminator_class may recursively
- # call itself and update the list of visited classes, and the initial
- # value must be an empty list. Hence not using 'visited_composed_classes'
- new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, [])
- if new_cls is None:
- path_to_item = kwargs.get("_path_to_item", ())
- disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py))
- raise ApiValueError(
- "Cannot deserialize input data due to invalid discriminator "
- "value. The OpenAPI document has no mapping for discriminator "
- "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item)
- )
-
- if new_cls in visited_composed_classes:
- # if we are making an instance of a composed schema Descendent
- # which allOf includes Ancestor, then Ancestor contains
- # a discriminator that includes Descendent.
- # So if we make an instance of Descendent, we have to make an
- # instance of Ancestor to hold the allOf properties.
- # This code detects that use case and makes the instance of Ancestor
- # For example:
- # When making an instance of Dog, _visited_composed_classes = (Dog,)
- # then we make an instance of Animal to include in dog._composed_instances
- # so when we are here, cls is Animal
- # cls.discriminator != None
- # cls not in _visited_composed_classes
- # new_cls = Dog
- # but we know we know that we already have Dog
- # because it is in visited_composed_classes
- # so make Animal here
- return super(OpenApiModel, cls).__new__(cls)
-
- # Build a list containing all oneOf and anyOf descendants.
- oneof_anyof_classes = None
- if cls._composed_schemas is not None:
- oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ())
- oneof_anyof_child = new_cls in oneof_anyof_classes
- kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,)
-
- if cls._composed_schemas.get("allOf") and oneof_anyof_child:
- # Validate that we can make self because when we make the
- # new_cls it will not include the allOf validations in self
- self_inst = super(OpenApiModel, cls).__new__(cls)
- self_inst.__init__(*args, **kwargs)
-
- if kwargs.get("_spec_property_naming", False):
- # when true, implies new is from deserialization
- new_inst = new_cls._new_from_openapi_data(*args, **kwargs)
- else:
- new_inst = new_cls.__new__(new_cls, *args, **kwargs)
- new_inst.__init__(*args, **kwargs)
-
- return new_inst
-
- @classmethod
- @convert_js_args_to_python_args
- def _new_from_openapi_data(cls, *args, **kwargs):
- # this function uses the discriminator to
- # pick a new schema/class to instantiate because a discriminator
- # propertyName value was passed in
-
- if len(args) == 1:
- arg = args[0]
- if arg is None and is_type_nullable(cls):
- # The input data is the 'null' value and the type is nullable.
- return None
-
- if issubclass(cls, ModelComposed) and allows_single_value_input(cls):
- model_kwargs = {}
- oneof_instance = get_oneof_instance(cls, model_kwargs, kwargs, model_arg=arg)
- return oneof_instance
-
- visited_composed_classes = kwargs.get("_visited_composed_classes", ())
- if cls.discriminator is None or cls in visited_composed_classes:
- # Use case 1: this openapi schema (cls) does not have a discriminator
- # Use case 2: we have already visited this class before and are sure that we
- # want to instantiate it this time. We have visited this class deserializing
- # a payload with a discriminator. During that process we traveled through
- # this class but did not make an instance of it. Now we are making an
- # instance of a composed class which contains cls in it, so this time make an instance of cls.
- #
- # Here's an example of use case 2: If Animal has a discriminator
- # petType and we pass in "Dog", and the class Dog
- # allOf includes Animal, we move through Animal
- # once using the discriminator, and pick Dog.
- # Then in the composed schema dog Dog, we will make an instance of the
- # Animal class (because Dal has allOf: Animal) but this time we won't travel
- # through Animal's discriminator because we passed in
- # _visited_composed_classes = (Animal,)
-
- return cls._from_openapi_data(*args, **kwargs)
-
- # Get the name and value of the discriminator property.
- # The discriminator name is obtained from the discriminator meta-data
- # and the discriminator value is obtained from the input data.
- discr_propertyname_py = list(cls.discriminator.keys())[0]
- discr_propertyname_js = cls.attribute_map[discr_propertyname_py]
- if discr_propertyname_js in kwargs:
- discr_value = kwargs[discr_propertyname_js]
- elif discr_propertyname_py in kwargs:
- discr_value = kwargs[discr_propertyname_py]
- else:
- # The input data does not contain the discriminator property.
- path_to_item = kwargs.get("_path_to_item", ())
- raise ApiValueError(
- "Cannot deserialize input data due to missing discriminator. "
- "The discriminator property '%s' is missing at path: %s" % (discr_propertyname_js, path_to_item)
- )
-
- # Implementation note: the last argument to get_discriminator_class
- # is a list of visited classes. get_discriminator_class may recursively
- # call itself and update the list of visited classes, and the initial
- # value must be an empty list. Hence not using 'visited_composed_classes'
- new_cls = get_discriminator_class(cls, discr_propertyname_py, discr_value, [])
- if new_cls is None:
- path_to_item = kwargs.get("_path_to_item", ())
- disc_prop_value = kwargs.get(discr_propertyname_js, kwargs.get(discr_propertyname_py))
- raise ApiValueError(
- "Cannot deserialize input data due to invalid discriminator "
- "value. The OpenAPI document has no mapping for discriminator "
- "property '%s'='%s' at path: %s" % (discr_propertyname_js, disc_prop_value, path_to_item)
- )
-
- if new_cls in visited_composed_classes:
- # if we are making an instance of a composed schema Descendent
- # which allOf includes Ancestor, then Ancestor contains
- # a discriminator that includes Descendent.
- # So if we make an instance of Descendent, we have to make an
- # instance of Ancestor to hold the allOf properties.
- # This code detects that use case and makes the instance of Ancestor
- # For example:
- # When making an instance of Dog, _visited_composed_classes = (Dog,)
- # then we make an instance of Animal to include in dog._composed_instances
- # so when we are here, cls is Animal
- # cls.discriminator != None
- # cls not in _visited_composed_classes
- # new_cls = Dog
- # but we know we know that we already have Dog
- # because it is in visited_composed_classes
- # so make Animal here
- return cls._from_openapi_data(*args, **kwargs)
-
- # Build a list containing all oneOf and anyOf descendants.
- oneof_anyof_classes = None
- if cls._composed_schemas is not None:
- oneof_anyof_classes = cls._composed_schemas.get("oneOf", ()) + cls._composed_schemas.get("anyOf", ())
- oneof_anyof_child = new_cls in oneof_anyof_classes
- kwargs["_visited_composed_classes"] = visited_composed_classes + (cls,)
-
- if cls._composed_schemas.get("allOf") and oneof_anyof_child:
- # Validate that we can make self because when we make the
- # new_cls it will not include the allOf validations in self
- self_inst = cls._from_openapi_data(*args, **kwargs)
-
- new_inst = new_cls._new_from_openapi_data(*args, **kwargs)
- return new_inst
-
-
-class ModelSimple(OpenApiModel):
- """the parent class of models whose type != object in their
- swagger/openapi"""
-
- def __setitem__(self, name, value):
- """set the value of an attribute using square-bracket notation: `instance[attr] = val`"""
- if name in self.required_properties:
- self.__dict__[name] = value
- return
-
- self.set_attribute(name, value)
-
- def get(self, name, default=None):
- """returns the value of an attribute or some default value if the attribute was not set"""
- if name in self.required_properties:
- return self.__dict__[name]
-
- return self.__dict__["_data_store"].get(name, default)
-
- def __getitem__(self, name):
- """get the value of an attribute using square-bracket notation: `instance[attr]`"""
- if name in self:
- return self.get(name)
-
- raise ApiAttributeError(
- "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e]
- )
-
- def __contains__(self, name):
- """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`"""
- if name in self.required_properties:
- return name in self.__dict__
-
- return name in self.__dict__["_data_store"]
-
- def to_str(self):
- """Returns the string representation of the model"""
- return str(self.value)
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, self.__class__):
- return False
-
- this_val = self._data_store["value"]
- that_val = other._data_store["value"]
- types = set()
- types.add(this_val.__class__)
- types.add(that_val.__class__)
- vals_equal = this_val == that_val
- return vals_equal
-
-
-class ModelNormal(OpenApiModel):
- """the parent class of models whose type == object in their
- swagger/openapi"""
-
- def __setitem__(self, name, value):
- """set the value of an attribute using square-bracket notation: `instance[attr] = val`"""
- if name in self.required_properties:
- self.__dict__[name] = value
- return
-
- self.set_attribute(name, value)
-
- def get(self, name, default=None):
- """returns the value of an attribute or some default value if the attribute was not set"""
- if name in self.required_properties:
- return self.__dict__[name]
-
- return self.__dict__["_data_store"].get(name, default)
-
- def __getitem__(self, name):
- """get the value of an attribute using square-bracket notation: `instance[attr]`"""
- if name in self:
- return self.get(name)
-
- raise ApiAttributeError(
- "{0} has no attribute '{1}'".format(type(self).__name__, name), [e for e in [self._path_to_item, name] if e]
- )
-
- def __contains__(self, name):
- """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`"""
- if name in self.required_properties:
- return name in self.__dict__
-
- return name in self.__dict__["_data_store"]
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- return model_to_dict(self, serialize=False)
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, self.__class__):
- return False
-
- if not set(self._data_store.keys()) == set(other._data_store.keys()):
- return False
- for _var_name, this_val in self._data_store.items():
- that_val = other._data_store[_var_name]
- types = set()
- types.add(this_val.__class__)
- types.add(that_val.__class__)
- vals_equal = this_val == that_val
- if not vals_equal:
- return False
- return True
-
-
-class ModelComposed(OpenApiModel):
- """the parent class of models whose type == object in their
- swagger/openapi and have oneOf/allOf/anyOf
-
- When one sets a property we use var_name_to_model_instances to store the value in
- the correct class instances + run any type checking + validation code.
- When one gets a property we use var_name_to_model_instances to get the value
- from the correct class instances.
- This allows multiple composed schemas to contain the same property with additive
- constraints on the value.
-
- _composed_schemas (dict) stores the anyOf/allOf/oneOf classes
- key (str): allOf/oneOf/anyOf
- value (list): the classes in the XOf definition.
- Note: none_type can be included when the openapi document version >= 3.1.0
- _composed_instances (list): stores a list of instances of the composed schemas
- defined in _composed_schemas. When properties are accessed in the self instance,
- they are returned from the self._data_store or the data stores in the instances
- in self._composed_schemas
- _var_name_to_model_instances (dict): maps between a variable name on self and
- the composed instances (self included) which contain that data
- key (str): property name
- value (list): list of class instances, self or instances in _composed_instances
- which contain the value that the key is referring to.
- """
-
- def __setitem__(self, name, value):
- """set the value of an attribute using square-bracket notation: `instance[attr] = val`"""
- if name in self.required_properties:
- self.__dict__[name] = value
- return
-
- """
- Use cases:
- 1. additional_properties_type is None (additionalProperties == False in spec)
- Check for property presence in self.openapi_types
- if not present then throw an error
- if present set in self, set attribute
- always set on composed schemas
- 2. additional_properties_type exists
- set attribute on self
- always set on composed schemas
- """
- if self.additional_properties_type is None:
- """
- For an attribute to exist on a composed schema it must:
- - fulfill schema_requirements in the self composed schema not considering oneOf/anyOf/allOf schemas AND
- - fulfill schema_requirements in each oneOf/anyOf/allOf schemas
-
- schema_requirements:
- For an attribute to exist on a schema it must:
- - be present in properties at the schema OR
- - have additionalProperties unset (defaults additionalProperties = any type) OR
- - have additionalProperties set
- """
- if name not in self.openapi_types:
- raise ApiAttributeError(
- "{0} has no attribute '{1}'".format(type(self).__name__, name),
- [e for e in [self._path_to_item, name] if e],
- )
- # attribute must be set on self and composed instances
- self.set_attribute(name, value)
- for model_instance in self._composed_instances:
- setattr(model_instance, name, value)
- if name not in self._var_name_to_model_instances:
- # we assigned an additional property
- self.__dict__["_var_name_to_model_instances"][name] = self._composed_instances + [self]
- return None
-
- __unset_attribute_value__ = object()
-
- def get(self, name, default=None):
- """returns the value of an attribute or some default value if the attribute was not set"""
- if name in self.required_properties:
- return self.__dict__[name]
-
- # get the attribute from the correct instance
- model_instances = self._var_name_to_model_instances.get(name)
- values = []
- # A composed model stores self and child (oneof/anyOf/allOf) models under
- # self._var_name_to_model_instances.
- # Any property must exist in self and all model instances
- # The value stored in all model instances must be the same
- if model_instances:
- for model_instance in model_instances:
- if name in model_instance._data_store:
- v = model_instance._data_store[name]
- if v not in values:
- values.append(v)
- len_values = len(values)
- if len_values == 0:
- return default
- elif len_values == 1:
- return values[0]
- elif len_values > 1:
- raise ApiValueError(
- "Values stored for property {0} in {1} differ when looking "
- "at self and self's composed instances. All values must be "
- "the same".format(name, type(self).__name__),
- [e for e in [self._path_to_item, name] if e],
- )
-
- def __getitem__(self, name):
- """get the value of an attribute using square-bracket notation: `instance[attr]`"""
- value = self.get(name, self.__unset_attribute_value__)
- if value is self.__unset_attribute_value__:
- raise ApiAttributeError(
- "{0} has no attribute '{1}'".format(type(self).__name__, name),
- [e for e in [self._path_to_item, name] if e],
- )
- return value
-
- def __contains__(self, name):
- """used by `in` operator to check if an attribute value was set in an instance: `'attr' in instance`"""
-
- if name in self.required_properties:
- return name in self.__dict__
-
- model_instances = self._var_name_to_model_instances.get(name, self._additional_properties_model_instances)
-
- if model_instances:
- for model_instance in model_instances:
- if name in model_instance._data_store:
- return True
-
- return False
-
- def to_dict(self):
- """Returns the model properties as a dict"""
- return model_to_dict(self, serialize=False)
-
- def to_str(self):
- """Returns the string representation of the model"""
- return pprint.pformat(self.to_dict())
-
- def __eq__(self, other):
- """Returns true if both objects are equal"""
- if not isinstance(other, self.__class__):
- return False
-
- if not set(self._data_store.keys()) == set(other._data_store.keys()):
- return False
- for _var_name, this_val in self._data_store.items():
- that_val = other._data_store[_var_name]
- types = set()
- types.add(this_val.__class__)
- types.add(that_val.__class__)
- vals_equal = this_val == that_val
- if not vals_equal:
- return False
- return True
-
-
-COERCION_INDEX_BY_TYPE = {
- ModelComposed: 0,
- ModelNormal: 1,
- ModelSimple: 2,
- none_type: 3, # The type of 'None'.
- list: 4,
- dict: 5,
- float: 6,
- int: 7,
- bool: 8,
- datetime: 9,
- date: 10,
- str: 11,
- file_type: 12, # 'file_type' is an alias for the built-in 'file' or 'io.IOBase' type.
-}
-
-# these are used to limit what type conversions we try to do
-# when we have a valid type already and we want to try converting
-# to another type
-UPCONVERSION_TYPE_PAIRS = (
- (str, datetime),
- (str, date),
- (int, float), # A float may be serialized as an integer, e.g. '3' is a valid serialized float.
- (list, ModelComposed),
- (dict, ModelComposed),
- (str, ModelComposed),
- (int, ModelComposed),
- (float, ModelComposed),
- (list, ModelComposed),
- (list, ModelNormal),
- (dict, ModelNormal),
- (str, ModelSimple),
- (int, ModelSimple),
- (float, ModelSimple),
- (list, ModelSimple),
-)
-
-COERCIBLE_TYPE_PAIRS = {
- False: ( # client instantiation of a model with client data
- # (dict, ModelComposed),
- # (list, ModelComposed),
- # (dict, ModelNormal),
- # (list, ModelNormal),
- # (str, ModelSimple),
- # (int, ModelSimple),
- # (float, ModelSimple),
- # (list, ModelSimple),
- # (str, int),
- # (str, float),
- # (str, datetime),
- # (str, date),
- # (int, str),
- # (float, str),
- ),
- True: ( # server -> client data
- (dict, ModelComposed),
- (list, ModelComposed),
- (dict, ModelNormal),
- (list, ModelNormal),
- (str, ModelSimple),
- (int, ModelSimple),
- (float, ModelSimple),
- (list, ModelSimple),
- # (str, int),
- # (str, float),
- (str, datetime),
- (str, date),
- # (int, str),
- # (float, str),
- (str, file_type),
- ),
-}
-
-
-def get_simple_class(input_value):
- """Returns an input_value's simple class that we will use for type checking
- Python2:
- float and int will return int, where int is the python3 int backport
- str and unicode will return str, where str is the python3 str backport
- Note: float and int ARE both instances of int backport
- Note: str_py2 and unicode_py2 are NOT both instances of str backport
-
- Args:
- input_value (class/class_instance): the item for which we will return
- the simple class
- """
- if isinstance(input_value, type):
- # input_value is a class
- return input_value
- elif isinstance(input_value, tuple):
- return tuple
- elif isinstance(input_value, list):
- return list
- elif isinstance(input_value, dict):
- return dict
- elif isinstance(input_value, none_type):
- return none_type
- elif isinstance(input_value, file_type):
- return file_type
- elif isinstance(input_value, bool):
- # this must be higher than the int check because
- # isinstance(True, int) == True
- return bool
- elif isinstance(input_value, int):
- return int
- elif isinstance(input_value, datetime):
- # this must be higher than the date check because
- # isinstance(datetime_instance, date) == True
- return datetime
- elif isinstance(input_value, date):
- return date
- elif isinstance(input_value, str):
- return str
- return type(input_value)
-
-
-def check_allowed_values(allowed_values, input_variable_path, input_values):
- """Raises an exception if the input_values are not allowed
-
- Args:
- allowed_values (dict): the allowed_values dict
- input_variable_path (tuple): the path to the input variable
- input_values (list/str/int/float/date/datetime): the values that we
- are checking to see if they are in allowed_values
- """
- these_allowed_values = list(allowed_values[input_variable_path].values())
- if isinstance(input_values, list) and not set(input_values).issubset(set(these_allowed_values)):
- invalid_values = (", ".join(map(str, set(input_values) - set(these_allowed_values))),)
- raise ApiValueError(
- "Invalid values for `%s` [%s], must be a subset of [%s]"
- % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values)))
- )
- elif isinstance(input_values, dict) and not set(input_values.keys()).issubset(set(these_allowed_values)):
- invalid_values = ", ".join(map(str, set(input_values.keys()) - set(these_allowed_values)))
- raise ApiValueError(
- "Invalid keys in `%s` [%s], must be a subset of [%s]"
- % (input_variable_path[0], invalid_values, ", ".join(map(str, these_allowed_values)))
- )
- elif not isinstance(input_values, (list, dict)) and input_values not in these_allowed_values:
- raise ApiValueError(
- "Invalid value for `%s` (%s), must be one of %s"
- % (input_variable_path[0], input_values, these_allowed_values)
- )
-
-
-def is_json_validation_enabled(schema_keyword, configuration=None):
- """Returns true if JSON schema validation is enabled for the specified
- validation keyword. This can be used to skip JSON schema structural validation
- as requested in the configuration.
-
- Args:
- schema_keyword (string): the name of a JSON schema validation keyword.
- configuration (Configuration): the configuration class.
- """
-
- return (
- configuration is None
- or not hasattr(configuration, "_disabled_client_side_validations")
- or schema_keyword not in configuration._disabled_client_side_validations
- )
-
-
-def check_validations(validations, input_variable_path, input_values, configuration=None):
- """Raises an exception if the input_values are invalid
-
- Args:
- validations (dict): the validation dictionary.
- input_variable_path (tuple): the path to the input variable.
- input_values (list/str/int/float/date/datetime): the values that we
- are checking.
- configuration (Configuration): the configuration class.
- """
-
- if input_values is None:
- return
-
- current_validations = validations[input_variable_path]
- if (
- is_json_validation_enabled("multipleOf", configuration)
- and "multiple_of" in current_validations
- and isinstance(input_values, (int, float))
- and not (float(input_values) / current_validations["multiple_of"]).is_integer()
- ):
- # Note 'multipleOf' will be as good as the floating point arithmetic.
- raise ApiValueError(
- "Invalid value for `%s`, value must be a multiple of `%s`"
- % (input_variable_path[0], current_validations["multiple_of"])
- )
-
- if (
- is_json_validation_enabled("maxLength", configuration)
- and "max_length" in current_validations
- and len(input_values) > current_validations["max_length"]
- ):
- raise ApiValueError(
- "Invalid value for `%s`, length must be less than or equal to `%s`"
- % (input_variable_path[0], current_validations["max_length"])
- )
-
- if (
- is_json_validation_enabled("minLength", configuration)
- and "min_length" in current_validations
- and len(input_values) < current_validations["min_length"]
- ):
- raise ApiValueError(
- "Invalid value for `%s`, length must be greater than or equal to `%s`"
- % (input_variable_path[0], current_validations["min_length"])
- )
-
- if (
- is_json_validation_enabled("maxItems", configuration)
- and "max_items" in current_validations
- and len(input_values) > current_validations["max_items"]
- ):
- raise ApiValueError(
- "Invalid value for `%s`, number of items must be less than or equal to `%s`"
- % (input_variable_path[0], current_validations["max_items"])
- )
-
- if (
- is_json_validation_enabled("minItems", configuration)
- and "min_items" in current_validations
- and len(input_values) < current_validations["min_items"]
- ):
- raise ValueError(
- "Invalid value for `%s`, number of items must be greater than or equal to `%s`"
- % (input_variable_path[0], current_validations["min_items"])
- )
-
- items = ("exclusive_maximum", "inclusive_maximum", "exclusive_minimum", "inclusive_minimum")
- if any(item in current_validations for item in items):
- if isinstance(input_values, list):
- max_val = max(input_values)
- min_val = min(input_values)
- elif isinstance(input_values, dict):
- max_val = max(input_values.values())
- min_val = min(input_values.values())
- else:
- max_val = input_values
- min_val = input_values
-
- if (
- is_json_validation_enabled("exclusiveMaximum", configuration)
- and "exclusive_maximum" in current_validations
- and max_val >= current_validations["exclusive_maximum"]
- ):
- raise ApiValueError(
- "Invalid value for `%s`, must be a value less than `%s`"
- % (input_variable_path[0], current_validations["exclusive_maximum"])
- )
-
- if (
- is_json_validation_enabled("maximum", configuration)
- and "inclusive_maximum" in current_validations
- and max_val > current_validations["inclusive_maximum"]
- ):
- raise ApiValueError(
- "Invalid value for `%s`, must be a value less than or equal to `%s`"
- % (input_variable_path[0], current_validations["inclusive_maximum"])
- )
-
- if (
- is_json_validation_enabled("exclusiveMinimum", configuration)
- and "exclusive_minimum" in current_validations
- and min_val <= current_validations["exclusive_minimum"]
- ):
- raise ApiValueError(
- "Invalid value for `%s`, must be a value greater than `%s`"
- % (input_variable_path[0], current_validations["exclusive_maximum"])
- )
-
- if (
- is_json_validation_enabled("minimum", configuration)
- and "inclusive_minimum" in current_validations
- and min_val < current_validations["inclusive_minimum"]
- ):
- raise ApiValueError(
- "Invalid value for `%s`, must be a value greater than or equal to `%s`"
- % (input_variable_path[0], current_validations["inclusive_minimum"])
- )
- flags = current_validations.get("regex", {}).get("flags", 0)
- if (
- is_json_validation_enabled("pattern", configuration)
- and "regex" in current_validations
- and not re.search(current_validations["regex"]["pattern"], input_values, flags=flags)
- ):
- err_msg = r"Invalid value for `%s`, must match regular expression `%s`" % (
- input_variable_path[0],
- current_validations["regex"]["pattern"],
- )
- if flags != 0:
- # Don't print the regex flags if the flags are not
- # specified in the OAS document.
- err_msg = r"%s with flags=`%s`" % (err_msg, flags)
- raise ApiValueError(err_msg)
-
-
-def order_response_types(required_types):
- """Returns the required types sorted in coercion order
-
- Args:
- required_types (list/tuple): collection of classes or instance of
- list or dict with class information inside it.
-
- Returns:
- (list): coercion order sorted collection of classes or instance
- of list or dict with class information inside it.
- """
-
- def index_getter(class_or_instance):
- if isinstance(class_or_instance, list):
- return COERCION_INDEX_BY_TYPE[list]
- elif isinstance(class_or_instance, dict):
- return COERCION_INDEX_BY_TYPE[dict]
- elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelComposed):
- return COERCION_INDEX_BY_TYPE[ModelComposed]
- elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelNormal):
- return COERCION_INDEX_BY_TYPE[ModelNormal]
- elif inspect.isclass(class_or_instance) and issubclass(class_or_instance, ModelSimple):
- return COERCION_INDEX_BY_TYPE[ModelSimple]
- elif class_or_instance in COERCION_INDEX_BY_TYPE:
- return COERCION_INDEX_BY_TYPE[class_or_instance]
- raise ApiValueError("Unsupported type: %s" % class_or_instance)
-
- sorted_types = sorted(required_types, key=lambda class_or_instance: index_getter(class_or_instance))
- return sorted_types
-
-
-def remove_uncoercible(required_types_classes, current_item, spec_property_naming, must_convert=True):
- """Only keeps the type conversions that are possible
-
- Args:
- required_types_classes (tuple): tuple of classes that are required
- these should be ordered by COERCION_INDEX_BY_TYPE
- spec_property_naming (bool): True if the variable names in the input
- data are serialized names as specified in the OpenAPI document.
- False if the variables names in the input data are python
- variable names in PEP-8 snake case.
- current_item (any): the current item (input data) to be converted
-
- Keyword Args:
- must_convert (bool): if True the item to convert is of the wrong
- type and we want a big list of coercibles
- if False, we want a limited list of coercibles
-
- Returns:
- (list): the remaining coercible required types, classes only
- """
- current_type_simple = get_simple_class(current_item)
-
- results_classes = []
- for required_type_class in required_types_classes:
- # convert our models to OpenApiModel
- required_type_class_simplified = required_type_class
- if isinstance(required_type_class_simplified, type):
- if issubclass(required_type_class_simplified, ModelComposed):
- required_type_class_simplified = ModelComposed
- elif issubclass(required_type_class_simplified, ModelNormal):
- required_type_class_simplified = ModelNormal
- elif issubclass(required_type_class_simplified, ModelSimple):
- required_type_class_simplified = ModelSimple
-
- if required_type_class_simplified == current_type_simple:
- # don't consider converting to one's own class
- continue
-
- class_pair = (current_type_simple, required_type_class_simplified)
- if must_convert and class_pair in COERCIBLE_TYPE_PAIRS[spec_property_naming]:
- results_classes.append(required_type_class)
- elif class_pair in UPCONVERSION_TYPE_PAIRS:
- results_classes.append(required_type_class)
- return results_classes
-
-
-def get_discriminated_classes(cls):
- """
- Returns all the classes that a discriminator converts to
- TODO: lru_cache this
- """
- possible_classes = []
- key = list(cls.discriminator.keys())[0]
- if is_type_nullable(cls):
- possible_classes.append(cls)
- for discr_cls in cls.discriminator[key].values():
- if hasattr(discr_cls, "discriminator") and discr_cls.discriminator is not None:
- possible_classes.extend(get_discriminated_classes(discr_cls))
- else:
- possible_classes.append(discr_cls)
- return possible_classes
-
-
-def get_possible_classes(cls, from_server_context):
- # TODO: lru_cache this
- possible_classes = [cls]
- if from_server_context:
- return possible_classes
- if hasattr(cls, "discriminator") and cls.discriminator is not None:
- possible_classes = []
- possible_classes.extend(get_discriminated_classes(cls))
- elif issubclass(cls, ModelComposed):
- possible_classes.extend(composed_model_input_classes(cls))
- return possible_classes
-
-
-def get_required_type_classes(required_types_mixed, spec_property_naming):
- """Converts the tuple required_types into a tuple and a dict described
- below
-
- Args:
- required_types_mixed (tuple/list): will contain either classes or
- instance of list or dict
- spec_property_naming (bool): if True these values came from the
- server, and we use the data types in our endpoints.
- If False, we are client side and we need to include
- oneOf and discriminator classes inside the data types in our endpoints
-
- Returns:
- (valid_classes, dict_valid_class_to_child_types_mixed):
- valid_classes (tuple): the valid classes that the current item
- should be
- dict_valid_class_to_child_types_mixed (dict):
- valid_class (class): this is the key
- child_types_mixed (list/dict/tuple): describes the valid child
- types
- """
- valid_classes = []
- child_req_types_by_current_type = {}
- for required_type in required_types_mixed:
- if isinstance(required_type, list):
- valid_classes.append(list)
- child_req_types_by_current_type[list] = required_type
- elif isinstance(required_type, tuple):
- valid_classes.append(tuple)
- child_req_types_by_current_type[tuple] = required_type
- elif isinstance(required_type, dict):
- valid_classes.append(dict)
- child_req_types_by_current_type[dict] = required_type[str]
- else:
- valid_classes.extend(get_possible_classes(required_type, spec_property_naming))
- return tuple(valid_classes), child_req_types_by_current_type
-
-
-def change_keys_js_to_python(input_dict, model_class):
- """
- Converts from javascript_key keys in the input_dict to python_keys in
- the output dict using the mapping in model_class.
- If the input_dict contains a key which does not declared in the model_class,
- the key is added to the output dict as is. The assumption is the model_class
- may have undeclared properties (additionalProperties attribute in the OAS
- document).
- """
-
- if getattr(model_class, "attribute_map", None) is None:
- return input_dict
- output_dict = {}
- reversed_attr_map = {value: key for key, value in model_class.attribute_map.items()}
- for javascript_key, value in input_dict.items():
- python_key = reversed_attr_map.get(javascript_key)
- if python_key is None:
- # if the key is unknown, it is in error or it is an
- # additionalProperties variable
- python_key = javascript_key
- output_dict[python_key] = value
- return output_dict
-
-
-def get_type_error(var_value, path_to_item, valid_classes, key_type=False):
- error_msg = type_error_message(
- var_name=path_to_item[-1], var_value=var_value, valid_classes=valid_classes, key_type=key_type
- )
- return ApiTypeError(error_msg, path_to_item=path_to_item, valid_classes=valid_classes, key_type=key_type)
-
-
-def deserialize_primitive(data, klass, path_to_item):
- """Deserializes string to primitive type.
-
- :param data: str/int/float
- :param klass: str/class the class to convert to
-
- :return: int, float, str, bool, date, datetime
- """
- additional_message = ""
- try:
- if klass in {datetime, date}:
- additional_message = (
- "If you need your parameter to have a fallback "
- "string value, please set its type as `type: {}` in your "
- "spec. That allows the value to be any type. "
- )
- if klass == datetime:
- if len(data) < 8:
- raise ValueError("This is not a datetime")
- # The string should be in iso8601 datetime format.
- parsed_datetime = parse(data)
- date_only = (
- parsed_datetime.hour == 0
- and parsed_datetime.minute == 0
- and parsed_datetime.second == 0
- and parsed_datetime.tzinfo is None
- and 8 <= len(data) <= 10
- )
- if date_only:
- raise ValueError("This is a date, not a datetime")
- return parsed_datetime
- elif klass == date:
- if len(data) < 8:
- raise ValueError("This is not a date")
- return parse(data).date()
- else:
- converted_value = klass(data)
- if isinstance(data, str) and klass == float:
- if str(converted_value) != data:
- # '7' -> 7.0 -> '7.0' != '7'
- raise ValueError("This is not a float")
- return converted_value
- except (OverflowError, ValueError) as ex:
- # parse can raise OverflowError
- raise ApiValueError(
- "{0}Failed to parse {1} as {2}".format(additional_message, repr(data), klass.__name__),
- path_to_item=path_to_item,
- ) from ex
-
-
-def get_discriminator_class(model_class, discr_name, discr_value, cls_visited):
- """Returns the child class specified by the discriminator.
-
- Args:
- model_class (OpenApiModel): the model class.
- discr_name (string): the name of the discriminator property.
- discr_value (any): the discriminator value.
- cls_visited (list): list of model classes that have been visited.
- Used to determine the discriminator class without
- visiting circular references indefinitely.
-
- Returns:
- used_model_class (class/None): the chosen child class that will be used
- to deserialize the data, for example dog.Dog.
- If a class is not found, None is returned.
- """
-
- if model_class in cls_visited:
- # The class has already been visited and no suitable class was found.
- return None
- cls_visited.append(model_class)
- used_model_class = None
- if discr_name in model_class.discriminator:
- class_name_to_discr_class = model_class.discriminator[discr_name]
- used_model_class = class_name_to_discr_class.get(discr_value)
- if used_model_class is None:
- # We didn't find a discriminated class in class_name_to_discr_class.
- # So look in the ancestor or descendant discriminators
- # The discriminator mapping may exist in a descendant (anyOf, oneOf)
- # or ancestor (allOf).
- # Ancestor example: in the GrandparentAnimal -> ParentPet -> ChildCat
- # hierarchy, the discriminator mappings may be defined at any level
- # in the hierarchy.
- # Descendant example: mammal -> whale/zebra/Pig -> BasquePig/DanishPig
- # if we try to make BasquePig from mammal, we need to travel through
- # the oneOf descendant discriminators to find BasquePig
- descendant_classes = model_class._composed_schemas.get("oneOf", ()) + model_class._composed_schemas.get(
- "anyOf", ()
- )
- ancestor_classes = model_class._composed_schemas.get("allOf", ())
- possible_classes = descendant_classes + ancestor_classes
- for cls in possible_classes:
- # Check if the schema has inherited discriminators.
- if hasattr(cls, "discriminator") and cls.discriminator is not None:
- used_model_class = get_discriminator_class(cls, discr_name, discr_value, cls_visited)
- if used_model_class is not None:
- return used_model_class
- return used_model_class
-
-
-def deserialize_model(model_data, model_class, path_to_item, check_type, configuration, spec_property_naming):
- """Deserializes model_data to model instance.
-
- Args:
- model_data (int/str/float/bool/none_type/list/dict): data to instantiate the model
- model_class (OpenApiModel): the model class
- path_to_item (list): path to the model in the received data
- check_type (bool): whether to check the data tupe for the values in
- the model
- configuration (Configuration): the instance to use to convert files
- spec_property_naming (bool): True if the variable names in the input
- data are serialized names as specified in the OpenAPI document.
- False if the variables names in the input data are python
- variable names in PEP-8 snake case.
-
- Returns:
- model instance
-
- Raise:
- ApiTypeError
- ApiValueError
- ApiKeyError
- """
-
- kw_args = dict(
- _check_type=check_type,
- _path_to_item=path_to_item,
- _configuration=configuration,
- _spec_property_naming=spec_property_naming,
- )
-
- if issubclass(model_class, ModelSimple):
- return model_class._new_from_openapi_data(model_data, **kw_args)
- elif isinstance(model_data, list):
- return model_class._new_from_openapi_data(*model_data, **kw_args)
- if isinstance(model_data, dict):
- kw_args.update(model_data)
- return model_class._new_from_openapi_data(**kw_args)
- elif isinstance(model_data, PRIMITIVE_TYPES):
- return model_class._new_from_openapi_data(model_data, **kw_args)
-
-
-def deserialize_file(response_data, configuration, content_disposition=None):
- """Deserializes body to file
-
- Saves response body into a file in a temporary folder,
- using the filename from the `Content-Disposition` header if provided.
-
- Args:
- param response_data (str): the file data to write
- configuration (Configuration): the instance to use to convert files
-
- Keyword Args:
- content_disposition (str): the value of the Content-Disposition
- header
-
- Returns:
- (file_type): the deserialized file which is open
- The user is responsible for closing and reading the file
- """
- fd, path = tempfile.mkstemp(dir=configuration.temp_folder_path)
- os.close(fd)
- os.remove(path)
-
- 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:
- if isinstance(response_data, str):
- # change str to bytes so we can write it
- response_data = response_data.encode("utf-8")
- f.write(response_data)
-
- f = open(path, "rb")
- return f
-
-
-def attempt_convert_item(
- input_value,
- valid_classes,
- path_to_item,
- configuration,
- spec_property_naming,
- key_type=False,
- must_convert=False,
- check_type=True,
-):
- """
- Args:
- input_value (any): the data to convert
- valid_classes (any): the classes that are valid
- path_to_item (list): the path to the item to convert
- configuration (Configuration): the instance to use to convert files
- spec_property_naming (bool): True if the variable names in the input
- data are serialized names as specified in the OpenAPI document.
- False if the variables names in the input data are python
- variable names in PEP-8 snake case.
- key_type (bool): if True we need to convert a key type (not supported)
- must_convert (bool): if True we must convert
- check_type (bool): if True we check the type or the returned data in
- ModelComposed/ModelNormal/ModelSimple instances
-
- Returns:
- instance (any) the fixed item
-
- Raises:
- ApiTypeError
- ApiValueError
- ApiKeyError
- """
- valid_classes_ordered = order_response_types(valid_classes)
- valid_classes_coercible = remove_uncoercible(valid_classes_ordered, input_value, spec_property_naming)
- if not valid_classes_coercible or key_type:
- # we do not handle keytype errors, json will take care
- # of this for us
- if configuration is None or not configuration.discard_unknown_keys:
- raise get_type_error(input_value, path_to_item, valid_classes, key_type=key_type)
- for valid_class in valid_classes_coercible:
- try:
- if issubclass(valid_class, OpenApiModel):
- return deserialize_model(
- input_value, valid_class, path_to_item, check_type, configuration, spec_property_naming
- )
- elif valid_class == file_type:
- return deserialize_file(input_value, configuration)
- return deserialize_primitive(input_value, valid_class, path_to_item)
- except (ApiTypeError, ApiValueError, ApiKeyError) as conversion_exc:
- if must_convert:
- raise conversion_exc
- # if we have conversion errors when must_convert == False
- # we ignore the exception and move on to the next class
- continue
- # we were unable to convert, must_convert == False
- return input_value
-
-
-def is_type_nullable(input_type):
- """
- Returns true if None is an allowed value for the specified input_type.
-
- A type is nullable if at least one of the following conditions is true:
- 1. The OAS 'nullable' attribute has been specified,
- 1. The type is the 'null' type,
- 1. The type is a anyOf/oneOf composed schema, and a child schema is
- the 'null' type.
- Args:
- input_type (type): the class of the input_value that we are
- checking
- Returns:
- bool
- """
- if input_type is none_type:
- return True
- if issubclass(input_type, OpenApiModel) and input_type._nullable:
- return True
- if issubclass(input_type, ModelComposed):
- # If oneOf/anyOf, check if the 'null' type is one of the allowed types.
- for t in input_type._composed_schemas.get("oneOf", ()):
- if is_type_nullable(t):
- return True
- for t in input_type._composed_schemas.get("anyOf", ()):
- if is_type_nullable(t):
- return True
- return False
-
-
-def is_valid_type(input_class_simple, valid_classes):
- """
- Args:
- input_class_simple (class): the class of the input_value that we are
- checking
- valid_classes (tuple): the valid classes that the current item
- should be
- Returns:
- bool
- """
- if issubclass(input_class_simple, OpenApiModel) and valid_classes == (
- bool,
- date,
- datetime,
- dict,
- float,
- int,
- list,
- str,
- none_type,
- ):
- return True
- valid_type = input_class_simple in valid_classes
- if not valid_type and (issubclass(input_class_simple, OpenApiModel) or input_class_simple is none_type):
- for valid_class in valid_classes:
- if input_class_simple is none_type and is_type_nullable(valid_class):
- # Schema is oneOf/anyOf and the 'null' type is one of the allowed types.
- return True
- if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator):
- continue
- discr_propertyname_py = list(valid_class.discriminator.keys())[0]
- discriminator_classes = valid_class.discriminator[discr_propertyname_py].values()
- valid_type = is_valid_type(input_class_simple, discriminator_classes)
- if valid_type:
- return True
- return valid_type
-
-
-def validate_and_convert_types(
- input_value, required_types_mixed, path_to_item, spec_property_naming, _check_type, configuration=None
-):
- """Raises a TypeError is there is a problem, otherwise returns value
-
- Args:
- input_value (any): the data to validate/convert
- required_types_mixed (list/dict/tuple): A list of
- valid classes, or a list tuples of valid classes, or a dict where
- the value is a tuple of value classes
- path_to_item: (list) the path to the data being validated
- this stores a list of keys or indices to get to the data being
- validated
- spec_property_naming (bool): True if the variable names in the input
- data are serialized names as specified in the OpenAPI document.
- False if the variables names in the input data are python
- variable names in PEP-8 snake case.
- _check_type: (boolean) if true, type will be checked and conversion
- will be attempted.
- configuration: (Configuration): the configuration class to use
- when converting file_type items.
- If passed, conversion will be attempted when possible
- If not passed, no conversions will be attempted and
- exceptions will be raised
-
- Returns:
- the correctly typed value
-
- Raises:
- ApiTypeError
- """
- results = get_required_type_classes(required_types_mixed, spec_property_naming)
- valid_classes, child_req_types_by_current_type = results
-
- input_class_simple = get_simple_class(input_value)
- valid_type = is_valid_type(input_class_simple, valid_classes)
- if not valid_type:
- if configuration:
- # if input_value is not valid_type try to convert it
- converted_instance = attempt_convert_item(
- input_value,
- valid_classes,
- path_to_item,
- configuration,
- spec_property_naming,
- key_type=False,
- must_convert=True,
- check_type=_check_type,
- )
- return converted_instance
- else:
- raise get_type_error(input_value, path_to_item, valid_classes, key_type=False)
-
- # input_value's type is in valid_classes
- if len(valid_classes) > 1 and configuration:
- # there are valid classes which are not the current class
- valid_classes_coercible = remove_uncoercible(
- valid_classes, input_value, spec_property_naming, must_convert=False
- )
- if valid_classes_coercible:
- converted_instance = attempt_convert_item(
- input_value,
- valid_classes_coercible,
- path_to_item,
- configuration,
- spec_property_naming,
- key_type=False,
- must_convert=False,
- check_type=_check_type,
- )
- return converted_instance
-
- if child_req_types_by_current_type == {}:
- # all types are of the required types and there are no more inner
- # variables left to look at
- return input_value
- inner_required_types = child_req_types_by_current_type.get(type(input_value))
- if inner_required_types is None:
- # for this type, there are not more inner variables left to look at
- return input_value
- if isinstance(input_value, list):
- if input_value == []:
- # allow an empty list
- return input_value
- for index, inner_value in enumerate(input_value):
- inner_path = list(path_to_item)
- inner_path.append(index)
- input_value[index] = validate_and_convert_types(
- inner_value,
- inner_required_types,
- inner_path,
- spec_property_naming,
- _check_type,
- configuration=configuration,
- )
- elif isinstance(input_value, dict):
- if input_value == {}:
- # allow an empty dict
- return input_value
- for inner_key, inner_val in input_value.items():
- inner_path = list(path_to_item)
- inner_path.append(inner_key)
- if get_simple_class(inner_key) != str:
- raise get_type_error(inner_key, inner_path, valid_classes, key_type=True)
- input_value[inner_key] = validate_and_convert_types(
- inner_val,
- inner_required_types,
- inner_path,
- spec_property_naming,
- _check_type,
- configuration=configuration,
- )
- return input_value
-
-
-def model_to_dict(model_instance, serialize=True):
- """Returns the model properties as a dict
-
- Args:
- model_instance (one of your model instances): the model instance that
- will be converted to a dict.
-
- Keyword Args:
- serialize (bool): if True, the keys in the dict will be values from
- attribute_map
- """
- result = {}
- extract_item = lambda item: (
- (item[0], model_to_dict(item[1], serialize=serialize)) if hasattr(item[1], "_data_store") else item
- )
-
- model_instances = [model_instance]
- if model_instance._composed_schemas:
- model_instances.extend(model_instance._composed_instances)
- seen_json_attribute_names = set()
- used_fallback_python_attribute_names = set()
- py_to_json_map = {}
- for model_instance in model_instances:
- for attr, value in model_instance._data_store.items():
- if serialize:
- # we use get here because additional property key names do not
- # exist in attribute_map
- try:
- attr = model_instance.attribute_map[attr]
- py_to_json_map.update(model_instance.attribute_map)
- seen_json_attribute_names.add(attr)
- except KeyError:
- used_fallback_python_attribute_names.add(attr)
- if isinstance(value, list):
- if not value:
- # empty list or None
- result[attr] = value
- else:
- res = []
- for v in value:
- if isinstance(v, PRIMITIVE_TYPES) or v is None:
- res.append(v)
- elif isinstance(v, ModelSimple):
- res.append(v.value)
- elif isinstance(v, dict):
- res.append(dict(map(extract_item, v.items())))
- else:
- res.append(model_to_dict(v, serialize=serialize))
- result[attr] = res
- elif isinstance(value, dict):
- result[attr] = dict(map(extract_item, value.items()))
- elif isinstance(value, ModelSimple):
- result[attr] = value.value
- elif hasattr(value, "_data_store"):
- result[attr] = model_to_dict(value, serialize=serialize)
- else:
- result[attr] = value
- if serialize:
- for python_key in used_fallback_python_attribute_names:
- json_key = py_to_json_map.get(python_key)
- if json_key is None:
- continue
- if python_key == json_key:
- continue
- json_key_assigned_no_need_for_python_key = json_key in seen_json_attribute_names
- if json_key_assigned_no_need_for_python_key:
- del result[python_key]
-
- return result
-
-
-def type_error_message(var_value=None, var_name=None, valid_classes=None, key_type=None):
- """
- Keyword Args:
- var_value (any): the variable which has the type_error
- var_name (str): the name of the variable which has the typ error
- valid_classes (tuple): the accepted classes for current_item's
- value
- key_type (bool): False if our value is a value in a dict
- True if it is a key in a dict
- False if our item is an item in a list
- """
- key_or_value = "value"
- if key_type:
- key_or_value = "key"
- valid_classes_phrase = get_valid_classes_phrase(valid_classes)
- msg = "Invalid type for variable '{0}'. Required {1} type {2} and passed type was {3}".format(
- var_name,
- key_or_value,
- valid_classes_phrase,
- type(var_value).__name__,
- )
- return msg
-
-
-def get_valid_classes_phrase(input_classes):
- """Returns a string phrase describing what types are allowed"""
- all_classes = list(input_classes)
- all_classes = sorted(all_classes, key=lambda cls: cls.__name__)
- all_class_names = [cls.__name__ for cls in all_classes]
- if len(all_class_names) == 1:
- return "is {0}".format(all_class_names[0])
- return "is one of [{0}]".format(", ".join(all_class_names))
-
-
-def get_allof_instances(self, model_args, constant_args):
- """
- Args:
- self: the class we are handling
- model_args (dict): var_name to var_value
- used to make instances
- constant_args (dict):
- metadata arguments:
- _check_type
- _path_to_item
- _spec_property_naming
- _configuration
- _visited_composed_classes
-
- Returns
- composed_instances (list)
- """
- composed_instances = []
- for allof_class in self._composed_schemas["allOf"]:
-
- try:
- if constant_args.get("_spec_property_naming"):
- allof_instance = allof_class._from_openapi_data(**model_args, **constant_args)
- else:
- allof_instance = allof_class(**model_args, **constant_args)
- composed_instances.append(allof_instance)
- except Exception as ex:
- raise ApiValueError(
- "Invalid inputs given to generate an instance of '%s'. The "
- "input data was invalid for the allOf schema '%s' in the composed "
- "schema '%s'. Error=%s" % (allof_class.__name__, allof_class.__name__, self.__class__.__name__, str(ex))
- ) from ex
- return composed_instances
-
-
-def get_oneof_instance(cls, model_kwargs, constant_kwargs, model_arg=None):
- """
- Find the oneOf schema that matches the input data (e.g. payload).
- If exactly one schema matches the input data, an instance of that schema
- is returned.
- If zero or more than one schema match the input data, an exception is raised.
- In OAS 3.x, the payload MUST, by validation, match exactly one of the
- schemas described by oneOf.
-
- Args:
- cls: the class we are handling
- model_kwargs (dict): var_name to var_value
- The input data, e.g. the payload that must match a oneOf schema
- in the OpenAPI document.
- constant_kwargs (dict): var_name to var_value
- args that every model requires, including configuration, server
- and path to item.
-
- Kwargs:
- model_arg: (int, float, bool, str, date, datetime, ModelSimple, None):
- the value to assign to a primitive class or ModelSimple class
- Notes:
- - this is only passed in when oneOf includes types which are not object
- - None is used to suppress handling of model_arg, nullable models are handled in __new__
-
- Returns
- oneof_instance (instance)
- """
- if len(cls._composed_schemas["oneOf"]) == 0:
- return None
-
- oneof_instances = []
- # Iterate over each oneOf schema and determine if the input data
- # matches the oneOf schemas.
- for oneof_class in cls._composed_schemas["oneOf"]:
- # The composed oneOf schema allows the 'null' type and the input data
- # is the null value. This is a OAS >= 3.1 feature.
- if oneof_class is none_type:
- # skip none_types because we are deserializing dict data.
- # none_type deserialization is handled in the __new__ method
- continue
-
- single_value_input = allows_single_value_input(oneof_class)
-
- try:
- if not single_value_input:
- if constant_kwargs.get("_spec_property_naming"):
- oneof_instance = oneof_class._from_openapi_data(**model_kwargs, **constant_kwargs)
- else:
- oneof_instance = oneof_class(**model_kwargs, **constant_kwargs)
- else:
- if issubclass(oneof_class, ModelSimple):
- if constant_kwargs.get("_spec_property_naming"):
- oneof_instance = oneof_class._from_openapi_data(model_arg, **constant_kwargs)
- else:
- oneof_instance = oneof_class(model_arg, **constant_kwargs)
- elif oneof_class in PRIMITIVE_TYPES:
- oneof_instance = validate_and_convert_types(
- model_arg,
- (oneof_class,),
- constant_kwargs["_path_to_item"],
- constant_kwargs["_spec_property_naming"],
- constant_kwargs["_check_type"],
- configuration=constant_kwargs["_configuration"],
- )
- oneof_instances.append(oneof_instance)
- except Exception:
- pass
- if len(oneof_instances) == 0:
- raise ApiValueError(
- "Invalid inputs given to generate an instance of %s. None of the oneOf schemas matched the input data."
- % cls.__name__
- )
- elif len(oneof_instances) > 1:
- raise ApiValueError(
- "Invalid inputs given to generate an instance of %s. Multiple "
- "oneOf schemas matched the inputs, but a max of one is allowed."
- % cls.__name__
- )
- return oneof_instances[0]
-
-
-def get_anyof_instances(self, model_args, constant_args):
- """
- Args:
- self: the class we are handling
- model_args (dict): var_name to var_value
- The input data, e.g. the payload that must match at least one
- anyOf child schema in the OpenAPI document.
- constant_args (dict): var_name to var_value
- args that every model requires, including configuration, server
- and path to item.
-
- Returns
- anyof_instances (list)
- """
- anyof_instances = []
- if len(self._composed_schemas["anyOf"]) == 0:
- return anyof_instances
-
- for anyof_class in self._composed_schemas["anyOf"]:
- # The composed oneOf schema allows the 'null' type and the input data
- # is the null value. This is a OAS >= 3.1 feature.
- if anyof_class is none_type:
- # skip none_types because we are deserializing dict data.
- # none_type deserialization is handled in the __new__ method
- continue
-
- try:
- if constant_args.get("_spec_property_naming"):
- anyof_instance = anyof_class._from_openapi_data(**model_args, **constant_args)
- else:
- anyof_instance = anyof_class(**model_args, **constant_args)
- anyof_instances.append(anyof_instance)
- except Exception:
- pass
- if len(anyof_instances) == 0:
- raise ApiValueError(
- "Invalid inputs given to generate an instance of %s. None of the anyOf schemas matched the inputs."
- % self.__class__.__name__
- )
- return anyof_instances
-
-
-def get_discarded_args(self, composed_instances, model_args):
- """
- Gathers the args that were discarded by configuration.discard_unknown_keys
- """
- model_arg_keys = model_args.keys()
- discarded_args = set()
- # arguments passed to self were already converted to python names
- # before __init__ was called
- for instance in composed_instances:
- if instance.__class__ in self._composed_schemas["allOf"]:
- try:
- keys = instance.to_dict().keys()
- discarded_keys = model_args - keys
- discarded_args.update(discarded_keys)
- except Exception:
- # allOf integer schema will throw exception
- pass
- else:
- try:
- all_keys = set(model_to_dict(instance, serialize=False).keys())
- js_keys = model_to_dict(instance, serialize=True).keys()
- all_keys.update(js_keys)
- discarded_keys = model_arg_keys - all_keys
- discarded_args.update(discarded_keys)
- except Exception:
- # allOf integer schema will throw exception
- pass
- return discarded_args
-
-
-def validate_get_composed_info(constant_args, model_args, self):
- """
- For composed schemas, generate schema instances for
- all schemas in the oneOf/anyOf/allOf definition. If additional
- properties are allowed, also assign those properties on
- all matched schemas that contain additionalProperties.
- Openapi schemas are python classes.
-
- Exceptions are raised if:
- - 0 or > 1 oneOf schema matches the model_args input data
- - no anyOf schema matches the model_args input data
- - any of the allOf schemas do not match the model_args input data
-
- Args:
- constant_args (dict): these are the args that every model requires
- model_args (dict): these are the required and optional spec args that
- were passed in to make this model
- self (class): the class that we are instantiating
- This class contains self._composed_schemas
-
- Returns:
- composed_info (list): length three
- composed_instances (list): the composed instances which are not
- self
- var_name_to_model_instances (dict): a dict going from var_name
- to the model_instance which holds that var_name
- the model_instance may be self or an instance of one of the
- classes in self.composed_instances()
- additional_properties_model_instances (list): a list of the
- model instances which have the property
- additional_properties_type. This list can include self
- """
- # create composed_instances
- composed_instances = []
- allof_instances = get_allof_instances(self, model_args, constant_args)
- composed_instances.extend(allof_instances)
- oneof_instance = get_oneof_instance(self.__class__, model_args, constant_args)
- if oneof_instance is not None:
- composed_instances.append(oneof_instance)
- anyof_instances = get_anyof_instances(self, model_args, constant_args)
- composed_instances.extend(anyof_instances)
- """
- set additional_properties_model_instances
- additional properties must be evaluated at the schema level
- so self's additional properties are most important
- If self is a composed schema with:
- - no properties defined in self
- - additionalProperties: False
- Then for object payloads every property is an additional property
- and they are not allowed, so only empty dict is allowed
-
- Properties must be set on all matching schemas
- so when a property is assigned toa composed instance, it must be set on all
- composed instances regardless of additionalProperties presence
- keeping it to prevent breaking changes in v5.0.1
- TODO remove cls._additional_properties_model_instances in 6.0.0
- """
- additional_properties_model_instances = []
- if self.additional_properties_type is not None:
- additional_properties_model_instances = [self]
-
- """
- no need to set properties on self in here, they will be set in __init__
- By here all composed schema oneOf/anyOf/allOf instances have their properties set using
- model_args
- """
- discarded_args = get_discarded_args(self, composed_instances, model_args)
-
- # map variable names to composed_instances
- var_name_to_model_instances = {}
- for prop_name in model_args:
- if prop_name not in discarded_args:
- var_name_to_model_instances[prop_name] = [self] + composed_instances
-
- return [composed_instances, var_name_to_model_instances, additional_properties_model_instances, discarded_args]
diff --git a/generated/groundlight_openapi_client/models/__init__.py b/generated/groundlight_openapi_client/models/__init__.py
index 16412577..b32f25cf 100644
--- a/generated/groundlight_openapi_client/models/__init__.py
+++ b/generated/groundlight_openapi_client/models/__init__.py
@@ -1,69 +1,86 @@
+# coding: utf-8
+
# flake8: noqa
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
-# import all models into this package
-# if you have many models here with many references from one model to another this may
-# raise a RecursionError
-# to avoid this, import only the models that you directly need like:
-# from from groundlight_openapi_client.model.pet import Pet
-# or import this package, but before doing it, use:
-# import sys
-# sys.setrecursionlimit(n)
-from groundlight_openapi_client.model.action import Action
-from groundlight_openapi_client.model.action_list import ActionList
-from groundlight_openapi_client.model.all_notes import AllNotes
-from groundlight_openapi_client.model.annotations_requested_enum import AnnotationsRequestedEnum
-from groundlight_openapi_client.model.b_box_geometry import BBoxGeometry
-from groundlight_openapi_client.model.b_box_geometry_request import BBoxGeometryRequest
-from groundlight_openapi_client.model.binary_classification_result import BinaryClassificationResult
-from groundlight_openapi_client.model.blank_enum import BlankEnum
-from groundlight_openapi_client.model.bounding_box_mode_configuration import BoundingBoxModeConfiguration
-from groundlight_openapi_client.model.bounding_box_result import BoundingBoxResult
-from groundlight_openapi_client.model.channel_enum import ChannelEnum
-from groundlight_openapi_client.model.condition import Condition
-from groundlight_openapi_client.model.condition_request import ConditionRequest
-from groundlight_openapi_client.model.count_mode_configuration import CountModeConfiguration
-from groundlight_openapi_client.model.counting_result import CountingResult
-from groundlight_openapi_client.model.detector import Detector
-from groundlight_openapi_client.model.detector_creation_input_request import DetectorCreationInputRequest
-from groundlight_openapi_client.model.detector_group import DetectorGroup
-from groundlight_openapi_client.model.detector_group_request import DetectorGroupRequest
-from groundlight_openapi_client.model.detector_type_enum import DetectorTypeEnum
-from groundlight_openapi_client.model.edge_model_info import EdgeModelInfo
-from groundlight_openapi_client.model.escalation_type_enum import EscalationTypeEnum
-from groundlight_openapi_client.model.image_query import ImageQuery
-from groundlight_openapi_client.model.image_query_type_enum import ImageQueryTypeEnum
-from groundlight_openapi_client.model.inline_response200 import InlineResponse200
-from groundlight_openapi_client.model.inline_response2001 import InlineResponse2001
-from groundlight_openapi_client.model.inline_response2001_evaluation_results import InlineResponse2001EvaluationResults
-from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002
-from groundlight_openapi_client.model.inline_response200_summary import InlineResponse200Summary
-from groundlight_openapi_client.model.inline_response200_summary_class_counts import InlineResponse200SummaryClassCounts
-from groundlight_openapi_client.model.label import Label
-from groundlight_openapi_client.model.label_value import LabelValue
-from groundlight_openapi_client.model.label_value_request import LabelValueRequest
-from groundlight_openapi_client.model.mode_enum import ModeEnum
-from groundlight_openapi_client.model.multi_class_mode_configuration import MultiClassModeConfiguration
-from groundlight_openapi_client.model.multi_classification_result import MultiClassificationResult
-from groundlight_openapi_client.model.note import Note
-from groundlight_openapi_client.model.note_request import NoteRequest
-from groundlight_openapi_client.model.paginated_detector_list import PaginatedDetectorList
-from groundlight_openapi_client.model.paginated_image_query_list import PaginatedImageQueryList
-from groundlight_openapi_client.model.paginated_rule_list import PaginatedRuleList
-from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest
-from groundlight_openapi_client.model.payload_template import PayloadTemplate
-from groundlight_openapi_client.model.payload_template_request import PayloadTemplateRequest
-from groundlight_openapi_client.model.roi import ROI
-from groundlight_openapi_client.model.roi_request import ROIRequest
-from groundlight_openapi_client.model.result_type_enum import ResultTypeEnum
-from groundlight_openapi_client.model.rule import Rule
-from groundlight_openapi_client.model.rule_request import RuleRequest
-from groundlight_openapi_client.model.snooze_time_unit_enum import SnoozeTimeUnitEnum
-from groundlight_openapi_client.model.source import Source
-from groundlight_openapi_client.model.source_enum import SourceEnum
-from groundlight_openapi_client.model.status_enum import StatusEnum
-from groundlight_openapi_client.model.text_mode_configuration import TextModeConfiguration
-from groundlight_openapi_client.model.text_recognition_result import TextRecognitionResult
-from groundlight_openapi_client.model.verb_enum import VerbEnum
-from groundlight_openapi_client.model.webhook_action import WebhookAction
-from groundlight_openapi_client.model.webhook_action_request import WebhookActionRequest
+# import models into model package
+from groundlight_openapi_client.models.action import Action
+from groundlight_openapi_client.models.all_notes import AllNotes
+from groundlight_openapi_client.models.annotations_requested_enum import AnnotationsRequestedEnum
+from groundlight_openapi_client.models.b_box_geometry import BBoxGeometry
+from groundlight_openapi_client.models.b_box_geometry_request import BBoxGeometryRequest
+from groundlight_openapi_client.models.binary_classification_result import BinaryClassificationResult
+from groundlight_openapi_client.models.blank_enum import BlankEnum
+from groundlight_openapi_client.models.bounding_box_mode_configuration import BoundingBoxModeConfiguration
+from groundlight_openapi_client.models.bounding_box_result import BoundingBoxResult
+from groundlight_openapi_client.models.channel_enum import ChannelEnum
+from groundlight_openapi_client.models.condition import Condition
+from groundlight_openapi_client.models.condition_request import ConditionRequest
+from groundlight_openapi_client.models.count_mode_configuration import CountModeConfiguration
+from groundlight_openapi_client.models.counting_result import CountingResult
+from groundlight_openapi_client.models.detector import Detector
+from groundlight_openapi_client.models.detector_creation_input_request import DetectorCreationInputRequest
+from groundlight_openapi_client.models.detector_creation_input_request_mode_configuration import (
+ DetectorCreationInputRequestModeConfiguration,
+)
+from groundlight_openapi_client.models.detector_group import DetectorGroup
+from groundlight_openapi_client.models.detector_group_request import DetectorGroupRequest
+from groundlight_openapi_client.models.detector_status import DetectorStatus
+from groundlight_openapi_client.models.detector_type_enum import DetectorTypeEnum
+from groundlight_openapi_client.models.edge_model_info import EdgeModelInfo
+from groundlight_openapi_client.models.escalation_type_enum import EscalationTypeEnum
+from groundlight_openapi_client.models.get_detector_evaluation200_response import GetDetectorEvaluation200Response
+from groundlight_openapi_client.models.get_detector_evaluation200_response_evaluation_results import (
+ GetDetectorEvaluation200ResponseEvaluationResults,
+)
+from groundlight_openapi_client.models.get_detector_metrics200_response import GetDetectorMetrics200Response
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary import (
+ GetDetectorMetrics200ResponseSummary,
+)
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary_class_counts import (
+ GetDetectorMetrics200ResponseSummaryClassCounts,
+)
+from groundlight_openapi_client.models.image_query import ImageQuery
+from groundlight_openapi_client.models.image_query_result import ImageQueryResult
+from groundlight_openapi_client.models.image_query_type_enum import ImageQueryTypeEnum
+from groundlight_openapi_client.models.label import Label
+from groundlight_openapi_client.models.label_value import LabelValue
+from groundlight_openapi_client.models.label_value_request import LabelValueRequest
+from groundlight_openapi_client.models.mode_enum import ModeEnum
+from groundlight_openapi_client.models.multi_class_mode_configuration import MultiClassModeConfiguration
+from groundlight_openapi_client.models.multi_classification_result import MultiClassificationResult
+from groundlight_openapi_client.models.note import Note
+from groundlight_openapi_client.models.note_request import NoteRequest
+from groundlight_openapi_client.models.paginated_detector_list import PaginatedDetectorList
+from groundlight_openapi_client.models.paginated_image_query_list import PaginatedImageQueryList
+from groundlight_openapi_client.models.paginated_rule_list import PaginatedRuleList
+from groundlight_openapi_client.models.patched_detector_request import PatchedDetectorRequest
+from groundlight_openapi_client.models.payload_template import PayloadTemplate
+from groundlight_openapi_client.models.payload_template_request import PayloadTemplateRequest
+from groundlight_openapi_client.models.roi import ROI
+from groundlight_openapi_client.models.roi_request import ROIRequest
+from groundlight_openapi_client.models.result_type_enum import ResultTypeEnum
+from groundlight_openapi_client.models.rule import Rule
+from groundlight_openapi_client.models.rule_action import RuleAction
+from groundlight_openapi_client.models.rule_request import RuleRequest
+from groundlight_openapi_client.models.snooze_time_unit_enum import SnoozeTimeUnitEnum
+from groundlight_openapi_client.models.source import Source
+from groundlight_openapi_client.models.source_enum import SourceEnum
+from groundlight_openapi_client.models.status_enum import StatusEnum
+from groundlight_openapi_client.models.text_mode_configuration import TextModeConfiguration
+from groundlight_openapi_client.models.text_recognition_result import TextRecognitionResult
+from groundlight_openapi_client.models.verb_enum import VerbEnum
+from groundlight_openapi_client.models.webhook_action import WebhookAction
+from groundlight_openapi_client.models.webhook_action_request import WebhookActionRequest
+from groundlight_openapi_client.models.who_am_i200_response import WhoAmI200Response
diff --git a/generated/groundlight_openapi_client/models/action.py b/generated/groundlight_openapi_client/models/action.py
new file mode 100644
index 00000000..3e78264b
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/action.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field, StrictBool, StrictStr
+from groundlight_openapi_client.models.channel_enum import ChannelEnum
+
+
+class Action(BaseModel):
+ """
+ Action
+ """
+
+ channel: ChannelEnum = Field(...)
+ recipient: StrictStr = Field(...)
+ include_image: StrictBool = Field(...)
+ __properties = ["channel", "recipient", "include_image"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Action:
+ """Create an instance of Action from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Action:
+ """Create an instance of Action from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Action.parse_obj(obj)
+
+ _obj = Action.parse_obj({
+ "channel": obj.get("channel"),
+ "recipient": obj.get("recipient"),
+ "include_image": obj.get("include_image"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/all_notes.py b/generated/groundlight_openapi_client/models/all_notes.py
new file mode 100644
index 00000000..75a0c207
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/all_notes.py
@@ -0,0 +1,89 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List
+from pydantic import BaseModel, Field, conlist
+from groundlight_openapi_client.models.note import Note
+
+
+class AllNotes(BaseModel):
+ """
+ Serializes all notes for a given detector, grouped by type as listed in UserProfile.NoteCategoryChoices The fields must match whats in USERPROFILE.NoteCategoryChoices # noqa: E501
+ """
+
+ customer: conlist(Note) = Field(default=..., alias="CUSTOMER")
+ gl: conlist(Note) = Field(default=..., alias="GL")
+ __properties = ["CUSTOMER", "GL"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AllNotes:
+ """Create an instance of AllNotes from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in customer (list)
+ _items = []
+ if self.customer:
+ for _item in self.customer:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["CUSTOMER"] = _items
+ # override the default output from pydantic by calling `to_dict()` of each item in gl (list)
+ _items = []
+ if self.gl:
+ for _item in self.gl:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["GL"] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> AllNotes:
+ """Create an instance of AllNotes from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return AllNotes.parse_obj(obj)
+
+ _obj = AllNotes.parse_obj({
+ "customer": (
+ [Note.from_dict(_item) for _item in obj.get("CUSTOMER")] if obj.get("CUSTOMER") is not None else None
+ ),
+ "gl": [Note.from_dict(_item) for _item in obj.get("GL")] if obj.get("GL") is not None else None,
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/annotations_requested_enum.py b/generated/groundlight_openapi_client/models/annotations_requested_enum.py
new file mode 100644
index 00000000..3267d644
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/annotations_requested_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class AnnotationsRequestedEnum(str, Enum):
+ """
+ AnnotationsRequestedEnum
+ """
+
+ """
+ allowed enum values
+ """
+ BINARY_CLASSIFICATION = "BINARY_CLASSIFICATION"
+ BOUNDING_BOXES = "BOUNDING_BOXES"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> AnnotationsRequestedEnum:
+ """Create an instance of AnnotationsRequestedEnum from a JSON string"""
+ return AnnotationsRequestedEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/b_box_geometry.py b/generated/groundlight_openapi_client/models/b_box_geometry.py
new file mode 100644
index 00000000..6bf2f151
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/b_box_geometry.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Union
+from pydantic import BaseModel, Field, StrictFloat, StrictInt
+
+
+class BBoxGeometry(BaseModel):
+ """
+ Mixin for serializers to handle data in the StrictBaseModel format # noqa: E501
+ """
+
+ left: Union[StrictFloat, StrictInt] = Field(...)
+ top: Union[StrictFloat, StrictInt] = Field(...)
+ right: Union[StrictFloat, StrictInt] = Field(...)
+ bottom: Union[StrictFloat, StrictInt] = Field(...)
+ x: Union[StrictFloat, StrictInt] = Field(...)
+ y: Union[StrictFloat, StrictInt] = Field(...)
+ __properties = ["left", "top", "right", "bottom", "x", "y"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BBoxGeometry:
+ """Create an instance of BBoxGeometry from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "x",
+ "y",
+ },
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BBoxGeometry:
+ """Create an instance of BBoxGeometry from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return BBoxGeometry.parse_obj(obj)
+
+ _obj = BBoxGeometry.parse_obj({
+ "left": obj.get("left"),
+ "top": obj.get("top"),
+ "right": obj.get("right"),
+ "bottom": obj.get("bottom"),
+ "x": obj.get("x"),
+ "y": obj.get("y"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/b_box_geometry_request.py b/generated/groundlight_openapi_client/models/b_box_geometry_request.py
new file mode 100644
index 00000000..2ea93b1c
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/b_box_geometry_request.py
@@ -0,0 +1,73 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Union
+from pydantic import BaseModel, Field, StrictFloat, StrictInt
+
+
+class BBoxGeometryRequest(BaseModel):
+ """
+ Mixin for serializers to handle data in the StrictBaseModel format # noqa: E501
+ """
+
+ left: Union[StrictFloat, StrictInt] = Field(...)
+ top: Union[StrictFloat, StrictInt] = Field(...)
+ right: Union[StrictFloat, StrictInt] = Field(...)
+ bottom: Union[StrictFloat, StrictInt] = Field(...)
+ __properties = ["left", "top", "right", "bottom"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BBoxGeometryRequest:
+ """Create an instance of BBoxGeometryRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BBoxGeometryRequest:
+ """Create an instance of BBoxGeometryRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return BBoxGeometryRequest.parse_obj(obj)
+
+ _obj = BBoxGeometryRequest.parse_obj(
+ {"left": obj.get("left"), "top": obj.get("top"), "right": obj.get("right"), "bottom": obj.get("bottom")}
+ )
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/binary_classification_result.py b/generated/groundlight_openapi_client/models/binary_classification_result.py
new file mode 100644
index 00000000..374d6176
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/binary_classification_result.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictStr, confloat, conint, validator
+
+
+class BinaryClassificationResult(BaseModel):
+ """
+ BinaryClassificationResult
+ """
+
+ confidence: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = None
+ source: Optional[StrictStr] = None
+ result_type: Optional[StrictStr] = None
+ from_edge: Optional[StrictBool] = None
+ label: StrictStr = Field(...)
+ __properties = ["confidence", "source", "result_type", "from_edge", "label"]
+
+ @validator("result_type")
+ def result_type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in ("binary_classification",):
+ raise ValueError("must be one of enum values ('binary_classification')")
+ return value
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BinaryClassificationResult:
+ """Create an instance of BinaryClassificationResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if confidence (nullable) is None
+ # and __fields_set__ contains the field
+ if self.confidence is None and "confidence" in self.__fields_set__:
+ _dict["confidence"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BinaryClassificationResult:
+ """Create an instance of BinaryClassificationResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return BinaryClassificationResult.parse_obj(obj)
+
+ _obj = BinaryClassificationResult.parse_obj({
+ "confidence": obj.get("confidence"),
+ "source": obj.get("source"),
+ "result_type": obj.get("result_type"),
+ "from_edge": obj.get("from_edge"),
+ "label": obj.get("label"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/blank_enum.py b/generated/groundlight_openapi_client/models/blank_enum.py
new file mode 100644
index 00000000..16a26576
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/blank_enum.py
@@ -0,0 +1,35 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class BlankEnum(str, Enum):
+ """
+ BlankEnum
+ """
+
+ """
+ allowed enum values
+ """
+ EMPTY = ""
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BlankEnum:
+ """Create an instance of BlankEnum from a JSON string"""
+ return BlankEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/bounding_box_mode_configuration.py b/generated/groundlight_openapi_client/models/bounding_box_mode_configuration.py
new file mode 100644
index 00000000..11586ee2
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/bounding_box_mode_configuration.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr, conint
+
+
+class BoundingBoxModeConfiguration(BaseModel):
+ """
+ BoundingBoxModeConfiguration
+ """
+
+ class_name: StrictStr = Field(...)
+ max_num_bboxes: Optional[conint(strict=True, le=50, ge=1)] = None
+ __properties = ["class_name", "max_num_bboxes"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BoundingBoxModeConfiguration:
+ """Create an instance of BoundingBoxModeConfiguration from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BoundingBoxModeConfiguration:
+ """Create an instance of BoundingBoxModeConfiguration from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return BoundingBoxModeConfiguration.parse_obj(obj)
+
+ _obj = BoundingBoxModeConfiguration.parse_obj(
+ {"class_name": obj.get("class_name"), "max_num_bboxes": obj.get("max_num_bboxes")}
+ )
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/bounding_box_result.py b/generated/groundlight_openapi_client/models/bounding_box_result.py
new file mode 100644
index 00000000..209b8755
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/bounding_box_result.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictStr, confloat, conint, validator
+
+
+class BoundingBoxResult(BaseModel):
+ """
+ BoundingBoxResult
+ """
+
+ confidence: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = None
+ source: Optional[StrictStr] = None
+ result_type: Optional[StrictStr] = None
+ from_edge: Optional[StrictBool] = None
+ label: StrictStr = Field(...)
+ __properties = ["confidence", "source", "result_type", "from_edge", "label"]
+
+ @validator("result_type")
+ def result_type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in ("bounding_box",):
+ raise ValueError("must be one of enum values ('bounding_box')")
+ return value
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> BoundingBoxResult:
+ """Create an instance of BoundingBoxResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if confidence (nullable) is None
+ # and __fields_set__ contains the field
+ if self.confidence is None and "confidence" in self.__fields_set__:
+ _dict["confidence"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> BoundingBoxResult:
+ """Create an instance of BoundingBoxResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return BoundingBoxResult.parse_obj(obj)
+
+ _obj = BoundingBoxResult.parse_obj({
+ "confidence": obj.get("confidence"),
+ "source": obj.get("source"),
+ "result_type": obj.get("result_type"),
+ "from_edge": obj.get("from_edge"),
+ "label": obj.get("label"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/channel_enum.py b/generated/groundlight_openapi_client/models/channel_enum.py
new file mode 100644
index 00000000..79fba81b
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/channel_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class ChannelEnum(str, Enum):
+ """
+ ChannelEnum
+ """
+
+ """
+ allowed enum values
+ """
+ TEXT = "TEXT"
+ EMAIL = "EMAIL"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ChannelEnum:
+ """Create an instance of ChannelEnum from a JSON string"""
+ return ChannelEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/condition.py b/generated/groundlight_openapi_client/models/condition.py
new file mode 100644
index 00000000..15c2add1
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/condition.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict
+from pydantic import BaseModel, Field, StrictStr
+
+
+class Condition(BaseModel):
+ """
+ Condition
+ """
+
+ verb: StrictStr = Field(...)
+ parameters: Dict[str, Any] = Field(...)
+ __properties = ["verb", "parameters"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Condition:
+ """Create an instance of Condition from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Condition:
+ """Create an instance of Condition from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Condition.parse_obj(obj)
+
+ _obj = Condition.parse_obj({"verb": obj.get("verb"), "parameters": obj.get("parameters")})
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/condition_request.py b/generated/groundlight_openapi_client/models/condition_request.py
new file mode 100644
index 00000000..05062711
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/condition_request.py
@@ -0,0 +1,69 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict
+from pydantic import BaseModel, Field, StrictStr
+
+
+class ConditionRequest(BaseModel):
+ """
+ ConditionRequest
+ """
+
+ verb: StrictStr = Field(...)
+ parameters: Dict[str, Any] = Field(...)
+ __properties = ["verb", "parameters"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ConditionRequest:
+ """Create an instance of ConditionRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ConditionRequest:
+ """Create an instance of ConditionRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ConditionRequest.parse_obj(obj)
+
+ _obj = ConditionRequest.parse_obj({"verb": obj.get("verb"), "parameters": obj.get("parameters")})
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/count_mode_configuration.py b/generated/groundlight_openapi_client/models/count_mode_configuration.py
new file mode 100644
index 00000000..fcc61bce
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/count_mode_configuration.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictStr, conint
+
+
+class CountModeConfiguration(BaseModel):
+ """
+ CountModeConfiguration
+ """
+
+ max_count: Optional[conint(strict=True, le=50, ge=1)] = None
+ class_name: StrictStr = Field(...)
+ __properties = ["max_count", "class_name"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CountModeConfiguration:
+ """Create an instance of CountModeConfiguration from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CountModeConfiguration:
+ """Create an instance of CountModeConfiguration from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CountModeConfiguration.parse_obj(obj)
+
+ _obj = CountModeConfiguration.parse_obj(
+ {"max_count": obj.get("max_count"), "class_name": obj.get("class_name")}
+ )
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/counting_result.py b/generated/groundlight_openapi_client/models/counting_result.py
new file mode 100644
index 00000000..a48806ee
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/counting_result.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictStr, confloat, conint, validator
+
+
+class CountingResult(BaseModel):
+ """
+ CountingResult
+ """
+
+ confidence: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = None
+ source: Optional[StrictStr] = None
+ result_type: Optional[StrictStr] = None
+ from_edge: Optional[StrictBool] = None
+ count: Optional[conint(strict=True, ge=0)] = Field(...)
+ greater_than_max: Optional[StrictBool] = None
+ __properties = ["confidence", "source", "result_type", "from_edge", "count", "greater_than_max"]
+
+ @validator("result_type")
+ def result_type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in ("counting",):
+ raise ValueError("must be one of enum values ('counting')")
+ return value
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> CountingResult:
+ """Create an instance of CountingResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if confidence (nullable) is None
+ # and __fields_set__ contains the field
+ if self.confidence is None and "confidence" in self.__fields_set__:
+ _dict["confidence"] = None
+
+ # set to None if count (nullable) is None
+ # and __fields_set__ contains the field
+ if self.count is None and "count" in self.__fields_set__:
+ _dict["count"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> CountingResult:
+ """Create an instance of CountingResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return CountingResult.parse_obj(obj)
+
+ _obj = CountingResult.parse_obj({
+ "confidence": obj.get("confidence"),
+ "source": obj.get("source"),
+ "result_type": obj.get("result_type"),
+ "from_edge": obj.get("from_edge"),
+ "count": obj.get("count"),
+ "greater_than_max": obj.get("greater_than_max"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/detector.py b/generated/groundlight_openapi_client/models/detector.py
new file mode 100644
index 00000000..96d0eb9a
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/detector.py
@@ -0,0 +1,150 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, Field, StrictStr, confloat, conint, constr
+from groundlight_openapi_client.models.detector_status import DetectorStatus
+from groundlight_openapi_client.models.detector_type_enum import DetectorTypeEnum
+
+
+class Detector(BaseModel):
+ """
+ Groundlight Detectors provide answers to natural language questions about images. Each detector can answer a single question, and multiple detectors can be strung together for more complex logic. Detectors can be created through the create_detector method, or through the create_[MODE]_detector methods for pro tier users # noqa: E501
+ """
+
+ id: StrictStr = Field(default=..., description="A unique ID for this object.")
+ type: DetectorTypeEnum = Field(default=..., description="The type of this object.")
+ created_at: datetime = Field(default=..., description="When this detector was created.")
+ name: constr(strict=True, max_length=200) = Field(
+ default=..., description="A short, descriptive name for the detector."
+ )
+ query: StrictStr = Field(default=..., description="A question about the image.")
+ group_name: StrictStr = Field(default=..., description="Which group should this detector be part of?")
+ confidence_threshold: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = (
+ Field(
+ default=0.9,
+ description=(
+ "If the detector's prediction is below this confidence threshold, send the image query for human"
+ " review."
+ ),
+ )
+ )
+ patience_time: Optional[Union[confloat(le=3600, ge=0, strict=True), conint(le=3600, ge=0, strict=True)]] = Field(
+ default=30.0, description="How long Groundlight will attempt to generate a confident prediction"
+ )
+ metadata: Optional[Dict[str, Any]] = Field(default=..., description="Metadata about the detector.")
+ mode: StrictStr = Field(...)
+ mode_configuration: Optional[Dict[str, Any]] = Field(...)
+ status: Optional[DetectorStatus] = None
+ escalation_type: Optional[StrictStr] = None
+ __properties = [
+ "id",
+ "type",
+ "created_at",
+ "name",
+ "query",
+ "group_name",
+ "confidence_threshold",
+ "patience_time",
+ "metadata",
+ "mode",
+ "mode_configuration",
+ "status",
+ "escalation_type",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Detector:
+ """Create an instance of Detector from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "id",
+ "type",
+ "created_at",
+ "query",
+ "group_name",
+ "metadata",
+ "mode",
+ "mode_configuration",
+ },
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of status
+ if self.status:
+ _dict["status"] = self.status.to_dict()
+ # set to None if metadata (nullable) is None
+ # and __fields_set__ contains the field
+ if self.metadata is None and "metadata" in self.__fields_set__:
+ _dict["metadata"] = None
+
+ # set to None if mode_configuration (nullable) is None
+ # and __fields_set__ contains the field
+ if self.mode_configuration is None and "mode_configuration" in self.__fields_set__:
+ _dict["mode_configuration"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Detector:
+ """Create an instance of Detector from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Detector.parse_obj(obj)
+
+ _obj = Detector.parse_obj({
+ "id": obj.get("id"),
+ "type": obj.get("type"),
+ "created_at": obj.get("created_at"),
+ "name": obj.get("name"),
+ "query": obj.get("query"),
+ "group_name": obj.get("group_name"),
+ "confidence_threshold": (
+ obj.get("confidence_threshold") if obj.get("confidence_threshold") is not None else 0.9
+ ),
+ "patience_time": obj.get("patience_time") if obj.get("patience_time") is not None else 30.0,
+ "metadata": obj.get("metadata"),
+ "mode": obj.get("mode"),
+ "mode_configuration": obj.get("mode_configuration"),
+ "status": DetectorStatus.from_dict(obj.get("status")) if obj.get("status") is not None else None,
+ "escalation_type": obj.get("escalation_type"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/detector_creation_input_request.py b/generated/groundlight_openapi_client/models/detector_creation_input_request.py
new file mode 100644
index 00000000..05b41292
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/detector_creation_input_request.py
@@ -0,0 +1,149 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, confloat, conint, constr
+from groundlight_openapi_client.models.detector_creation_input_request_mode_configuration import (
+ DetectorCreationInputRequestModeConfiguration,
+)
+from groundlight_openapi_client.models.mode_enum import ModeEnum
+
+
+class DetectorCreationInputRequest(BaseModel):
+ """
+ Helper serializer for validating POST /detectors input. # noqa: E501
+ """
+
+ name: constr(strict=True, max_length=200, min_length=1) = Field(
+ default=..., description="A short, descriptive name for the detector."
+ )
+ query: constr(strict=True, max_length=300, min_length=1) = Field(
+ default=..., description="A question about the image."
+ )
+ group_name: Optional[constr(strict=True, max_length=100, min_length=1)] = Field(
+ default=None, description="Which group should this detector be part of?"
+ )
+ confidence_threshold: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = (
+ Field(
+ default=0.9,
+ description=(
+ "If the detector's prediction is below this confidence threshold, send the image query for human"
+ " review."
+ ),
+ )
+ )
+ patience_time: Optional[Union[confloat(le=3600, ge=0, strict=True), conint(le=3600, ge=0, strict=True)]] = Field(
+ default=30.0, description="How long Groundlight will attempt to generate a confident prediction"
+ )
+ pipeline_config: Optional[constr(strict=True, max_length=100)] = Field(
+ default=None, description="(Advanced usage) Configuration needed to instantiate a prediction pipeline."
+ )
+ metadata: Optional[constr(strict=True, max_length=1362, min_length=1)] = Field(
+ default=None,
+ description=(
+ "Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after"
+ " encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding."
+ ),
+ )
+ mode: Optional[ModeEnum] = Field(
+ default=None,
+ description=(
+ "Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` -"
+ " MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX"
+ ),
+ )
+ mode_configuration: Optional[DetectorCreationInputRequestModeConfiguration] = None
+ __properties = [
+ "name",
+ "query",
+ "group_name",
+ "confidence_threshold",
+ "patience_time",
+ "pipeline_config",
+ "metadata",
+ "mode",
+ "mode_configuration",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DetectorCreationInputRequest:
+ """Create an instance of DetectorCreationInputRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of mode_configuration
+ if self.mode_configuration:
+ _dict["mode_configuration"] = self.mode_configuration.to_dict()
+ # set to None if pipeline_config (nullable) is None
+ # and __fields_set__ contains the field
+ if self.pipeline_config is None and "pipeline_config" in self.__fields_set__:
+ _dict["pipeline_config"] = None
+
+ # set to None if mode_configuration (nullable) is None
+ # and __fields_set__ contains the field
+ if self.mode_configuration is None and "mode_configuration" in self.__fields_set__:
+ _dict["mode_configuration"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DetectorCreationInputRequest:
+ """Create an instance of DetectorCreationInputRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return DetectorCreationInputRequest.parse_obj(obj)
+
+ _obj = DetectorCreationInputRequest.parse_obj({
+ "name": obj.get("name"),
+ "query": obj.get("query"),
+ "group_name": obj.get("group_name"),
+ "confidence_threshold": (
+ obj.get("confidence_threshold") if obj.get("confidence_threshold") is not None else 0.9
+ ),
+ "patience_time": obj.get("patience_time") if obj.get("patience_time") is not None else 30.0,
+ "pipeline_config": obj.get("pipeline_config"),
+ "metadata": obj.get("metadata"),
+ "mode": obj.get("mode"),
+ "mode_configuration": (
+ DetectorCreationInputRequestModeConfiguration.from_dict(obj.get("mode_configuration"))
+ if obj.get("mode_configuration") is not None
+ else None
+ ),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/detector_creation_input_request_mode_configuration.py b/generated/groundlight_openapi_client/models/detector_creation_input_request_mode_configuration.py
new file mode 100644
index 00000000..e3ef10ef
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/detector_creation_input_request_mode_configuration.py
@@ -0,0 +1,203 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import json
+import pprint
+import re # noqa: F401
+
+from typing import Any, List, Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from groundlight_openapi_client.models.bounding_box_mode_configuration import BoundingBoxModeConfiguration
+from groundlight_openapi_client.models.count_mode_configuration import CountModeConfiguration
+from groundlight_openapi_client.models.multi_class_mode_configuration import MultiClassModeConfiguration
+from groundlight_openapi_client.models.text_mode_configuration import TextModeConfiguration
+from typing import Union, Any, List, TYPE_CHECKING
+from pydantic import StrictStr, Field
+
+DETECTORCREATIONINPUTREQUESTMODECONFIGURATION_ONE_OF_SCHEMAS = [
+ "BoundingBoxModeConfiguration",
+ "CountModeConfiguration",
+ "MultiClassModeConfiguration",
+ "TextModeConfiguration",
+]
+
+
+class DetectorCreationInputRequestModeConfiguration(BaseModel):
+ """
+ DetectorCreationInputRequestModeConfiguration
+ """
+
+ # data type: CountModeConfiguration
+ oneof_schema_1_validator: Optional[CountModeConfiguration] = None
+ # data type: MultiClassModeConfiguration
+ oneof_schema_2_validator: Optional[MultiClassModeConfiguration] = None
+ # data type: TextModeConfiguration
+ oneof_schema_3_validator: Optional[TextModeConfiguration] = None
+ # data type: BoundingBoxModeConfiguration
+ oneof_schema_4_validator: Optional[BoundingBoxModeConfiguration] = None
+ if TYPE_CHECKING:
+ actual_instance: Union[
+ BoundingBoxModeConfiguration, CountModeConfiguration, MultiClassModeConfiguration, TextModeConfiguration
+ ]
+ else:
+ actual_instance: Any
+ one_of_schemas: List[str] = Field(DETECTORCREATIONINPUTREQUESTMODECONFIGURATION_ONE_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @validator("actual_instance")
+ def actual_instance_must_validate_oneof(cls, v):
+ if v is None:
+ return v
+
+ instance = DetectorCreationInputRequestModeConfiguration.construct()
+ error_messages = []
+ match = 0
+ # validate data type: CountModeConfiguration
+ if not isinstance(v, CountModeConfiguration):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CountModeConfiguration`")
+ else:
+ match += 1
+ # validate data type: MultiClassModeConfiguration
+ if not isinstance(v, MultiClassModeConfiguration):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MultiClassModeConfiguration`")
+ else:
+ match += 1
+ # validate data type: TextModeConfiguration
+ if not isinstance(v, TextModeConfiguration):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TextModeConfiguration`")
+ else:
+ match += 1
+ # validate data type: BoundingBoxModeConfiguration
+ if not isinstance(v, BoundingBoxModeConfiguration):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxModeConfiguration`")
+ else:
+ match += 1
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in DetectorCreationInputRequestModeConfiguration"
+ " with oneOf schemas: BoundingBoxModeConfiguration, CountModeConfiguration,"
+ " MultiClassModeConfiguration, TextModeConfiguration. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when setting `actual_instance` in DetectorCreationInputRequestModeConfiguration with"
+ " oneOf schemas: BoundingBoxModeConfiguration, CountModeConfiguration, MultiClassModeConfiguration,"
+ " TextModeConfiguration. Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DetectorCreationInputRequestModeConfiguration:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DetectorCreationInputRequestModeConfiguration:
+ """Returns the object represented by the json string"""
+ instance = DetectorCreationInputRequestModeConfiguration.construct()
+ if json_str is None:
+ return instance
+
+ error_messages = []
+ match = 0
+
+ # deserialize data into CountModeConfiguration
+ try:
+ instance.actual_instance = CountModeConfiguration.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into MultiClassModeConfiguration
+ try:
+ instance.actual_instance = MultiClassModeConfiguration.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into TextModeConfiguration
+ try:
+ instance.actual_instance = TextModeConfiguration.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into BoundingBoxModeConfiguration
+ try:
+ instance.actual_instance = BoundingBoxModeConfiguration.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into"
+ " DetectorCreationInputRequestModeConfiguration with oneOf schemas: BoundingBoxModeConfiguration,"
+ " CountModeConfiguration, MultiClassModeConfiguration, TextModeConfiguration. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when deserializing the JSON string into DetectorCreationInputRequestModeConfiguration"
+ " with oneOf schemas: BoundingBoxModeConfiguration, CountModeConfiguration,"
+ " MultiClassModeConfiguration, TextModeConfiguration. Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ to_json = getattr(self.actual_instance, "to_json", None)
+ if callable(to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ to_dict = getattr(self.actual_instance, "to_dict", None)
+ if callable(to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
diff --git a/generated/groundlight_openapi_client/models/detector_group.py b/generated/groundlight_openapi_client/models/detector_group.py
new file mode 100644
index 00000000..5dfb319a
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/detector_group.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field, StrictStr, constr
+
+
+class DetectorGroup(BaseModel):
+ """
+ DetectorGroup
+ """
+
+ id: StrictStr = Field(...)
+ name: constr(strict=True, max_length=100) = Field(...)
+ __properties = ["id", "name"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DetectorGroup:
+ """Create an instance of DetectorGroup from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "id",
+ },
+ exclude_none=True,
+ )
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DetectorGroup:
+ """Create an instance of DetectorGroup from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return DetectorGroup.parse_obj(obj)
+
+ _obj = DetectorGroup.parse_obj({"id": obj.get("id"), "name": obj.get("name")})
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/detector_group_request.py b/generated/groundlight_openapi_client/models/detector_group_request.py
new file mode 100644
index 00000000..d4b2d919
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/detector_group_request.py
@@ -0,0 +1,67 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field, constr
+
+
+class DetectorGroupRequest(BaseModel):
+ """
+ DetectorGroupRequest
+ """
+
+ name: constr(strict=True, max_length=100, min_length=1) = Field(...)
+ __properties = ["name"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DetectorGroupRequest:
+ """Create an instance of DetectorGroupRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DetectorGroupRequest:
+ """Create an instance of DetectorGroupRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return DetectorGroupRequest.parse_obj(obj)
+
+ _obj = DetectorGroupRequest.parse_obj({"name": obj.get("name")})
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/detector_status.py b/generated/groundlight_openapi_client/models/detector_status.py
new file mode 100644
index 00000000..8ec350a0
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/detector_status.py
@@ -0,0 +1,158 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import json
+import pprint
+import re # noqa: F401
+
+from typing import Any, List, Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from groundlight_openapi_client.models.blank_enum import BlankEnum
+from groundlight_openapi_client.models.status_enum import StatusEnum
+from typing import Union, Any, List, TYPE_CHECKING
+from pydantic import StrictStr, Field
+
+DETECTORSTATUS_ONE_OF_SCHEMAS = ["BlankEnum", "StatusEnum"]
+
+
+class DetectorStatus(BaseModel):
+ """
+ DetectorStatus
+ """
+
+ # data type: StatusEnum
+ oneof_schema_1_validator: Optional[StatusEnum] = None
+ # data type: BlankEnum
+ oneof_schema_2_validator: Optional[BlankEnum] = None
+ if TYPE_CHECKING:
+ actual_instance: Union[BlankEnum, StatusEnum]
+ else:
+ actual_instance: Any
+ one_of_schemas: List[str] = Field(DETECTORSTATUS_ONE_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @validator("actual_instance")
+ def actual_instance_must_validate_oneof(cls, v):
+ instance = DetectorStatus.construct()
+ error_messages = []
+ match = 0
+ # validate data type: StatusEnum
+ if not isinstance(v, StatusEnum):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `StatusEnum`")
+ else:
+ match += 1
+ # validate data type: BlankEnum
+ if not isinstance(v, BlankEnum):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BlankEnum`")
+ else:
+ match += 1
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in DetectorStatus with oneOf schemas: BlankEnum,"
+ " StatusEnum. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when setting `actual_instance` in DetectorStatus with oneOf schemas: BlankEnum,"
+ " StatusEnum. Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> DetectorStatus:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DetectorStatus:
+ """Returns the object represented by the json string"""
+ instance = DetectorStatus.construct()
+ error_messages = []
+ match = 0
+
+ # deserialize data into StatusEnum
+ try:
+ instance.actual_instance = StatusEnum.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into BlankEnum
+ try:
+ instance.actual_instance = BlankEnum.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into DetectorStatus with oneOf schemas:"
+ " BlankEnum, StatusEnum. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when deserializing the JSON string into DetectorStatus with oneOf schemas: BlankEnum,"
+ " StatusEnum. Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ to_json = getattr(self.actual_instance, "to_json", None)
+ if callable(to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ to_dict = getattr(self.actual_instance, "to_dict", None)
+ if callable(to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
diff --git a/generated/groundlight_openapi_client/models/detector_type_enum.py b/generated/groundlight_openapi_client/models/detector_type_enum.py
new file mode 100644
index 00000000..f1b372fe
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/detector_type_enum.py
@@ -0,0 +1,35 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class DetectorTypeEnum(str, Enum):
+ """
+ DetectorTypeEnum
+ """
+
+ """
+ allowed enum values
+ """
+ DETECTOR = "detector"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> DetectorTypeEnum:
+ """Create an instance of DetectorTypeEnum from a JSON string"""
+ return DetectorTypeEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/edge_model_info.py b/generated/groundlight_openapi_client/models/edge_model_info.py
new file mode 100644
index 00000000..92514771
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/edge_model_info.py
@@ -0,0 +1,105 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Optional
+from pydantic import BaseModel, StrictStr
+
+
+class EdgeModelInfo(BaseModel):
+ """
+ Information for the model running on edge, including temporary presigned urls to the model binaries # noqa: E501
+ """
+
+ model_binary_id: Optional[StrictStr] = None
+ model_binary_url: Optional[StrictStr] = None
+ oodd_model_binary_id: Optional[StrictStr] = None
+ oodd_model_binary_url: Optional[StrictStr] = None
+ pipeline_config: Optional[Any] = None
+ oodd_pipeline_config: Optional[Any] = None
+ predictor_metadata: Optional[Any] = None
+ __properties = [
+ "model_binary_id",
+ "model_binary_url",
+ "oodd_model_binary_id",
+ "oodd_model_binary_url",
+ "pipeline_config",
+ "oodd_pipeline_config",
+ "predictor_metadata",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EdgeModelInfo:
+ """Create an instance of EdgeModelInfo from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if pipeline_config (nullable) is None
+ # and __fields_set__ contains the field
+ if self.pipeline_config is None and "pipeline_config" in self.__fields_set__:
+ _dict["pipeline_config"] = None
+
+ # set to None if oodd_pipeline_config (nullable) is None
+ # and __fields_set__ contains the field
+ if self.oodd_pipeline_config is None and "oodd_pipeline_config" in self.__fields_set__:
+ _dict["oodd_pipeline_config"] = None
+
+ # set to None if predictor_metadata (nullable) is None
+ # and __fields_set__ contains the field
+ if self.predictor_metadata is None and "predictor_metadata" in self.__fields_set__:
+ _dict["predictor_metadata"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> EdgeModelInfo:
+ """Create an instance of EdgeModelInfo from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return EdgeModelInfo.parse_obj(obj)
+
+ _obj = EdgeModelInfo.parse_obj({
+ "model_binary_id": obj.get("model_binary_id"),
+ "model_binary_url": obj.get("model_binary_url"),
+ "oodd_model_binary_id": obj.get("oodd_model_binary_id"),
+ "oodd_model_binary_url": obj.get("oodd_model_binary_url"),
+ "pipeline_config": obj.get("pipeline_config"),
+ "oodd_pipeline_config": obj.get("oodd_pipeline_config"),
+ "predictor_metadata": obj.get("predictor_metadata"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/escalation_type_enum.py b/generated/groundlight_openapi_client/models/escalation_type_enum.py
new file mode 100644
index 00000000..4f6690f1
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/escalation_type_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class EscalationTypeEnum(str, Enum):
+ """
+ EscalationTypeEnum
+ """
+
+ """
+ allowed enum values
+ """
+ STANDARD = "STANDARD"
+ NO_HUMAN_LABELING = "NO_HUMAN_LABELING"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> EscalationTypeEnum:
+ """Create an instance of EscalationTypeEnum from a JSON string"""
+ return EscalationTypeEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/get_detector_evaluation200_response.py b/generated/groundlight_openapi_client/models/get_detector_evaluation200_response.py
new file mode 100644
index 00000000..d9e4d338
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/get_detector_evaluation200_response.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel
+from groundlight_openapi_client.models.get_detector_evaluation200_response_evaluation_results import (
+ GetDetectorEvaluation200ResponseEvaluationResults,
+)
+
+
+class GetDetectorEvaluation200Response(BaseModel):
+ """
+ GetDetectorEvaluation200Response
+ """
+
+ evaluation_results: Optional[GetDetectorEvaluation200ResponseEvaluationResults] = None
+ __properties = ["evaluation_results"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> GetDetectorEvaluation200Response:
+ """Create an instance of GetDetectorEvaluation200Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of evaluation_results
+ if self.evaluation_results:
+ _dict["evaluation_results"] = self.evaluation_results.to_dict()
+ # set to None if evaluation_results (nullable) is None
+ # and __fields_set__ contains the field
+ if self.evaluation_results is None and "evaluation_results" in self.__fields_set__:
+ _dict["evaluation_results"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> GetDetectorEvaluation200Response:
+ """Create an instance of GetDetectorEvaluation200Response from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return GetDetectorEvaluation200Response.parse_obj(obj)
+
+ _obj = GetDetectorEvaluation200Response.parse_obj({
+ "evaluation_results": (
+ GetDetectorEvaluation200ResponseEvaluationResults.from_dict(obj.get("evaluation_results"))
+ if obj.get("evaluation_results") is not None
+ else None
+ )
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/get_detector_evaluation200_response_evaluation_results.py b/generated/groundlight_openapi_client/models/get_detector_evaluation200_response_evaluation_results.py
new file mode 100644
index 00000000..e9bb02fc
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/get_detector_evaluation200_response_evaluation_results.py
@@ -0,0 +1,211 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, Optional, Union
+from pydantic import BaseModel, StrictFloat, StrictInt
+
+
+class GetDetectorEvaluation200ResponseEvaluationResults(BaseModel):
+ """
+ GetDetectorEvaluation200ResponseEvaluationResults
+ """
+
+ eval_timestamp: Optional[datetime] = None
+ total_ground_truth_examples: Optional[StrictInt] = None
+ total_labeled_examples: Optional[StrictInt] = None
+ kfold_pooled__balanced_accuracy: Optional[Union[StrictFloat, StrictInt]] = None
+ kfold_pooled__positive_accuracy: Optional[Union[StrictFloat, StrictInt]] = None
+ kfold_pooled__negative_accuracy: Optional[Union[StrictFloat, StrictInt]] = None
+ precision__mean: Optional[Union[StrictFloat, StrictInt]] = None
+ recall__mean: Optional[Union[StrictFloat, StrictInt]] = None
+ roc_auc__mean: Optional[Union[StrictFloat, StrictInt]] = None
+ balanced_system_accuracies: Optional[Dict[str, Any]] = None
+ positive_system_accuracies: Optional[Dict[str, Any]] = None
+ negative_system_accuracies: Optional[Dict[str, Any]] = None
+ mean_absolute_error__mean: Optional[Union[StrictFloat, StrictInt]] = None
+ objdet_precision__mean: Optional[Union[StrictFloat, StrictInt]] = None
+ objdet_recall__mean: Optional[Union[StrictFloat, StrictInt]] = None
+ objdet_f1_score__mean: Optional[Union[StrictFloat, StrictInt]] = None
+ class_accuracies: Optional[Dict[str, Any]] = None
+ confusion_dict: Optional[Dict[str, Any]] = None
+ num_examples_per_class: Optional[Dict[str, Any]] = None
+ __properties = [
+ "eval_timestamp",
+ "total_ground_truth_examples",
+ "total_labeled_examples",
+ "kfold_pooled__balanced_accuracy",
+ "kfold_pooled__positive_accuracy",
+ "kfold_pooled__negative_accuracy",
+ "precision__mean",
+ "recall__mean",
+ "roc_auc__mean",
+ "balanced_system_accuracies",
+ "positive_system_accuracies",
+ "negative_system_accuracies",
+ "mean_absolute_error__mean",
+ "objdet_precision__mean",
+ "objdet_recall__mean",
+ "objdet_f1_score__mean",
+ "class_accuracies",
+ "confusion_dict",
+ "num_examples_per_class",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> GetDetectorEvaluation200ResponseEvaluationResults:
+ """Create an instance of GetDetectorEvaluation200ResponseEvaluationResults from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if total_ground_truth_examples (nullable) is None
+ # and __fields_set__ contains the field
+ if self.total_ground_truth_examples is None and "total_ground_truth_examples" in self.__fields_set__:
+ _dict["total_ground_truth_examples"] = None
+
+ # set to None if total_labeled_examples (nullable) is None
+ # and __fields_set__ contains the field
+ if self.total_labeled_examples is None and "total_labeled_examples" in self.__fields_set__:
+ _dict["total_labeled_examples"] = None
+
+ # set to None if kfold_pooled__positive_accuracy (nullable) is None
+ # and __fields_set__ contains the field
+ if self.kfold_pooled__positive_accuracy is None and "kfold_pooled__positive_accuracy" in self.__fields_set__:
+ _dict["kfold_pooled__positive_accuracy"] = None
+
+ # set to None if kfold_pooled__negative_accuracy (nullable) is None
+ # and __fields_set__ contains the field
+ if self.kfold_pooled__negative_accuracy is None and "kfold_pooled__negative_accuracy" in self.__fields_set__:
+ _dict["kfold_pooled__negative_accuracy"] = None
+
+ # set to None if precision__mean (nullable) is None
+ # and __fields_set__ contains the field
+ if self.precision__mean is None and "precision__mean" in self.__fields_set__:
+ _dict["precision__mean"] = None
+
+ # set to None if recall__mean (nullable) is None
+ # and __fields_set__ contains the field
+ if self.recall__mean is None and "recall__mean" in self.__fields_set__:
+ _dict["recall__mean"] = None
+
+ # set to None if roc_auc__mean (nullable) is None
+ # and __fields_set__ contains the field
+ if self.roc_auc__mean is None and "roc_auc__mean" in self.__fields_set__:
+ _dict["roc_auc__mean"] = None
+
+ # set to None if balanced_system_accuracies (nullable) is None
+ # and __fields_set__ contains the field
+ if self.balanced_system_accuracies is None and "balanced_system_accuracies" in self.__fields_set__:
+ _dict["balanced_system_accuracies"] = None
+
+ # set to None if positive_system_accuracies (nullable) is None
+ # and __fields_set__ contains the field
+ if self.positive_system_accuracies is None and "positive_system_accuracies" in self.__fields_set__:
+ _dict["positive_system_accuracies"] = None
+
+ # set to None if negative_system_accuracies (nullable) is None
+ # and __fields_set__ contains the field
+ if self.negative_system_accuracies is None and "negative_system_accuracies" in self.__fields_set__:
+ _dict["negative_system_accuracies"] = None
+
+ # set to None if mean_absolute_error__mean (nullable) is None
+ # and __fields_set__ contains the field
+ if self.mean_absolute_error__mean is None and "mean_absolute_error__mean" in self.__fields_set__:
+ _dict["mean_absolute_error__mean"] = None
+
+ # set to None if objdet_precision__mean (nullable) is None
+ # and __fields_set__ contains the field
+ if self.objdet_precision__mean is None and "objdet_precision__mean" in self.__fields_set__:
+ _dict["objdet_precision__mean"] = None
+
+ # set to None if objdet_recall__mean (nullable) is None
+ # and __fields_set__ contains the field
+ if self.objdet_recall__mean is None and "objdet_recall__mean" in self.__fields_set__:
+ _dict["objdet_recall__mean"] = None
+
+ # set to None if objdet_f1_score__mean (nullable) is None
+ # and __fields_set__ contains the field
+ if self.objdet_f1_score__mean is None and "objdet_f1_score__mean" in self.__fields_set__:
+ _dict["objdet_f1_score__mean"] = None
+
+ # set to None if class_accuracies (nullable) is None
+ # and __fields_set__ contains the field
+ if self.class_accuracies is None and "class_accuracies" in self.__fields_set__:
+ _dict["class_accuracies"] = None
+
+ # set to None if confusion_dict (nullable) is None
+ # and __fields_set__ contains the field
+ if self.confusion_dict is None and "confusion_dict" in self.__fields_set__:
+ _dict["confusion_dict"] = None
+
+ # set to None if num_examples_per_class (nullable) is None
+ # and __fields_set__ contains the field
+ if self.num_examples_per_class is None and "num_examples_per_class" in self.__fields_set__:
+ _dict["num_examples_per_class"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> GetDetectorEvaluation200ResponseEvaluationResults:
+ """Create an instance of GetDetectorEvaluation200ResponseEvaluationResults from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return GetDetectorEvaluation200ResponseEvaluationResults.parse_obj(obj)
+
+ _obj = GetDetectorEvaluation200ResponseEvaluationResults.parse_obj({
+ "eval_timestamp": obj.get("eval_timestamp"),
+ "total_ground_truth_examples": obj.get("total_ground_truth_examples"),
+ "total_labeled_examples": obj.get("total_labeled_examples"),
+ "kfold_pooled__balanced_accuracy": obj.get("kfold_pooled__balanced_accuracy"),
+ "kfold_pooled__positive_accuracy": obj.get("kfold_pooled__positive_accuracy"),
+ "kfold_pooled__negative_accuracy": obj.get("kfold_pooled__negative_accuracy"),
+ "precision__mean": obj.get("precision__mean"),
+ "recall__mean": obj.get("recall__mean"),
+ "roc_auc__mean": obj.get("roc_auc__mean"),
+ "balanced_system_accuracies": obj.get("balanced_system_accuracies"),
+ "positive_system_accuracies": obj.get("positive_system_accuracies"),
+ "negative_system_accuracies": obj.get("negative_system_accuracies"),
+ "mean_absolute_error__mean": obj.get("mean_absolute_error__mean"),
+ "objdet_precision__mean": obj.get("objdet_precision__mean"),
+ "objdet_recall__mean": obj.get("objdet_recall__mean"),
+ "objdet_f1_score__mean": obj.get("objdet_f1_score__mean"),
+ "class_accuracies": obj.get("class_accuracies"),
+ "confusion_dict": obj.get("confusion_dict"),
+ "num_examples_per_class": obj.get("num_examples_per_class"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/get_detector_metrics200_response.py b/generated/groundlight_openapi_client/models/get_detector_metrics200_response.py
new file mode 100644
index 00000000..76cc0ea5
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/get_detector_metrics200_response.py
@@ -0,0 +1,85 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary import (
+ GetDetectorMetrics200ResponseSummary,
+)
+
+
+class GetDetectorMetrics200Response(BaseModel):
+ """
+ GetDetectorMetrics200Response
+ """
+
+ summary: Optional[GetDetectorMetrics200ResponseSummary] = None
+ __properties = ["summary"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> GetDetectorMetrics200Response:
+ """Create an instance of GetDetectorMetrics200Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of summary
+ if self.summary:
+ _dict["summary"] = self.summary.to_dict()
+ # set to None if summary (nullable) is None
+ # and __fields_set__ contains the field
+ if self.summary is None and "summary" in self.__fields_set__:
+ _dict["summary"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> GetDetectorMetrics200Response:
+ """Create an instance of GetDetectorMetrics200Response from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return GetDetectorMetrics200Response.parse_obj(obj)
+
+ _obj = GetDetectorMetrics200Response.parse_obj({
+ "summary": (
+ GetDetectorMetrics200ResponseSummary.from_dict(obj.get("summary"))
+ if obj.get("summary") is not None
+ else None
+ )
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/get_detector_metrics200_response_summary.py b/generated/groundlight_openapi_client/models/get_detector_metrics200_response_summary.py
new file mode 100644
index 00000000..3e5541b3
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/get_detector_metrics200_response_summary.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel, StrictInt
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary_class_counts import (
+ GetDetectorMetrics200ResponseSummaryClassCounts,
+)
+
+
+class GetDetectorMetrics200ResponseSummary(BaseModel):
+ """
+ GetDetectorMetrics200ResponseSummary
+ """
+
+ num_ground_truth: Optional[StrictInt] = None
+ num_current_source_human: Optional[StrictInt] = None
+ class_counts: Optional[GetDetectorMetrics200ResponseSummaryClassCounts] = None
+ unconfident_counts: Optional[Dict[str, Any]] = None
+ total_iqs: Optional[StrictInt] = None
+ __properties = ["num_ground_truth", "num_current_source_human", "class_counts", "unconfident_counts", "total_iqs"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> GetDetectorMetrics200ResponseSummary:
+ """Create an instance of GetDetectorMetrics200ResponseSummary from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of class_counts
+ if self.class_counts:
+ _dict["class_counts"] = self.class_counts.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> GetDetectorMetrics200ResponseSummary:
+ """Create an instance of GetDetectorMetrics200ResponseSummary from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return GetDetectorMetrics200ResponseSummary.parse_obj(obj)
+
+ _obj = GetDetectorMetrics200ResponseSummary.parse_obj({
+ "num_ground_truth": obj.get("num_ground_truth"),
+ "num_current_source_human": obj.get("num_current_source_human"),
+ "class_counts": (
+ GetDetectorMetrics200ResponseSummaryClassCounts.from_dict(obj.get("class_counts"))
+ if obj.get("class_counts") is not None
+ else None
+ ),
+ "unconfident_counts": obj.get("unconfident_counts"),
+ "total_iqs": obj.get("total_iqs"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/get_detector_metrics200_response_summary_class_counts.py b/generated/groundlight_openapi_client/models/get_detector_metrics200_response_summary_class_counts.py
new file mode 100644
index 00000000..55f58fc0
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/get_detector_metrics200_response_summary_class_counts.py
@@ -0,0 +1,78 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Any, Dict, Optional
+from pydantic import BaseModel
+
+
+class GetDetectorMetrics200ResponseSummaryClassCounts(BaseModel):
+ """
+ GetDetectorMetrics200ResponseSummaryClassCounts
+ """
+
+ source_ml: Optional[Dict[str, Any]] = None
+ source_human: Optional[Dict[str, Any]] = None
+ cloud_labeler: Optional[Dict[str, Any]] = None
+ cloud: Optional[Dict[str, Any]] = None
+ total: Optional[Dict[str, Any]] = None
+ __properties = ["source_ml", "source_human", "cloud_labeler", "cloud", "total"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> GetDetectorMetrics200ResponseSummaryClassCounts:
+ """Create an instance of GetDetectorMetrics200ResponseSummaryClassCounts from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> GetDetectorMetrics200ResponseSummaryClassCounts:
+ """Create an instance of GetDetectorMetrics200ResponseSummaryClassCounts from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return GetDetectorMetrics200ResponseSummaryClassCounts.parse_obj(obj)
+
+ _obj = GetDetectorMetrics200ResponseSummaryClassCounts.parse_obj({
+ "source_ml": obj.get("source_ml"),
+ "source_human": obj.get("source_human"),
+ "cloud_labeler": obj.get("cloud_labeler"),
+ "cloud": obj.get("cloud"),
+ "total": obj.get("total"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/image_query.py b/generated/groundlight_openapi_client/models/image_query.py
new file mode 100644
index 00000000..ea4fa642
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/image_query.py
@@ -0,0 +1,167 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Any, Dict, List, Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist
+from groundlight_openapi_client.models.image_query_result import ImageQueryResult
+from groundlight_openapi_client.models.image_query_type_enum import ImageQueryTypeEnum
+from groundlight_openapi_client.models.result_type_enum import ResultTypeEnum
+from groundlight_openapi_client.models.roi import ROI
+
+
+class ImageQuery(BaseModel):
+ """
+ ImageQuery objects are the answers to natural language questions about images created by detectors. # noqa: E501
+ """
+
+ metadata: Optional[Dict[str, Any]] = Field(default=..., description="Metadata about the image query.")
+ id: StrictStr = Field(default=..., description="A unique ID for this object.")
+ type: ImageQueryTypeEnum = Field(default=..., description="The type of this object.")
+ created_at: datetime = Field(default=..., description="When was this detector created?")
+ query: StrictStr = Field(default=..., description="A question about the image.")
+ detector_id: StrictStr = Field(default=..., description="Which detector was used on this image query?")
+ result_type: ResultTypeEnum = Field(default=..., description="What type of result are we returning?")
+ result: Optional[ImageQueryResult] = Field(...)
+ patience_time: Union[StrictFloat, StrictInt] = Field(
+ default=..., description="How long to wait for a confident response."
+ )
+ confidence_threshold: Union[StrictFloat, StrictInt] = Field(
+ default=..., description="Min confidence needed to accept the response of the image query."
+ )
+ rois: Optional[conlist(ROI)] = Field(
+ default=..., description="An array of regions of interest (bounding boxes) collected on image"
+ )
+ text: Optional[StrictStr] = Field(default=..., description="A text field on image query.")
+ done_processing: Optional[StrictBool] = Field(
+ default=False,
+ description="EDGE ONLY - Whether the image query has completed escalating and will receive no new results.",
+ )
+ __properties = [
+ "metadata",
+ "id",
+ "type",
+ "created_at",
+ "query",
+ "detector_id",
+ "result_type",
+ "result",
+ "patience_time",
+ "confidence_threshold",
+ "rois",
+ "text",
+ "done_processing",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ImageQuery:
+ """Create an instance of ImageQuery from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "metadata",
+ "id",
+ "type",
+ "created_at",
+ "query",
+ "detector_id",
+ "result_type",
+ "patience_time",
+ "confidence_threshold",
+ "rois",
+ "text",
+ },
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of result
+ if self.result:
+ _dict["result"] = self.result.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in rois (list)
+ _items = []
+ if self.rois:
+ for _item in self.rois:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["rois"] = _items
+ # set to None if metadata (nullable) is None
+ # and __fields_set__ contains the field
+ if self.metadata is None and "metadata" in self.__fields_set__:
+ _dict["metadata"] = None
+
+ # set to None if result (nullable) is None
+ # and __fields_set__ contains the field
+ if self.result is None and "result" in self.__fields_set__:
+ _dict["result"] = None
+
+ # set to None if rois (nullable) is None
+ # and __fields_set__ contains the field
+ if self.rois is None and "rois" in self.__fields_set__:
+ _dict["rois"] = None
+
+ # set to None if text (nullable) is None
+ # and __fields_set__ contains the field
+ if self.text is None and "text" in self.__fields_set__:
+ _dict["text"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ImageQuery:
+ """Create an instance of ImageQuery from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ImageQuery.parse_obj(obj)
+
+ _obj = ImageQuery.parse_obj({
+ "metadata": obj.get("metadata"),
+ "id": obj.get("id"),
+ "type": obj.get("type"),
+ "created_at": obj.get("created_at"),
+ "query": obj.get("query"),
+ "detector_id": obj.get("detector_id"),
+ "result_type": obj.get("result_type"),
+ "result": ImageQueryResult.from_dict(obj.get("result")) if obj.get("result") is not None else None,
+ "patience_time": obj.get("patience_time"),
+ "confidence_threshold": obj.get("confidence_threshold"),
+ "rois": [ROI.from_dict(_item) for _item in obj.get("rois")] if obj.get("rois") is not None else None,
+ "text": obj.get("text"),
+ "done_processing": obj.get("done_processing") if obj.get("done_processing") is not None else False,
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/image_query_result.py b/generated/groundlight_openapi_client/models/image_query_result.py
new file mode 100644
index 00000000..e659480c
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/image_query_result.py
@@ -0,0 +1,230 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import json
+import pprint
+import re # noqa: F401
+
+from typing import Any, List, Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, validator
+from groundlight_openapi_client.models.binary_classification_result import BinaryClassificationResult
+from groundlight_openapi_client.models.bounding_box_result import BoundingBoxResult
+from groundlight_openapi_client.models.counting_result import CountingResult
+from groundlight_openapi_client.models.multi_classification_result import MultiClassificationResult
+from groundlight_openapi_client.models.text_recognition_result import TextRecognitionResult
+from typing import Union, Any, List, TYPE_CHECKING
+from pydantic import StrictStr, Field
+
+IMAGEQUERYRESULT_ONE_OF_SCHEMAS = [
+ "BinaryClassificationResult",
+ "BoundingBoxResult",
+ "CountingResult",
+ "MultiClassificationResult",
+ "TextRecognitionResult",
+]
+
+
+class ImageQueryResult(BaseModel):
+ """
+ ImageQueryResult
+ """
+
+ # data type: BinaryClassificationResult
+ oneof_schema_1_validator: Optional[BinaryClassificationResult] = None
+ # data type: CountingResult
+ oneof_schema_2_validator: Optional[CountingResult] = None
+ # data type: MultiClassificationResult
+ oneof_schema_3_validator: Optional[MultiClassificationResult] = None
+ # data type: TextRecognitionResult
+ oneof_schema_4_validator: Optional[TextRecognitionResult] = None
+ # data type: BoundingBoxResult
+ oneof_schema_5_validator: Optional[BoundingBoxResult] = None
+ if TYPE_CHECKING:
+ actual_instance: Union[
+ BinaryClassificationResult,
+ BoundingBoxResult,
+ CountingResult,
+ MultiClassificationResult,
+ TextRecognitionResult,
+ ]
+ else:
+ actual_instance: Any
+ one_of_schemas: List[str] = Field(IMAGEQUERYRESULT_ONE_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ discriminator_value_class_map = {}
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @validator("actual_instance")
+ def actual_instance_must_validate_oneof(cls, v):
+ if v is None:
+ return v
+
+ instance = ImageQueryResult.construct()
+ error_messages = []
+ match = 0
+ # validate data type: BinaryClassificationResult
+ if not isinstance(v, BinaryClassificationResult):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BinaryClassificationResult`")
+ else:
+ match += 1
+ # validate data type: CountingResult
+ if not isinstance(v, CountingResult):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CountingResult`")
+ else:
+ match += 1
+ # validate data type: MultiClassificationResult
+ if not isinstance(v, MultiClassificationResult):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MultiClassificationResult`")
+ else:
+ match += 1
+ # validate data type: TextRecognitionResult
+ if not isinstance(v, TextRecognitionResult):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TextRecognitionResult`")
+ else:
+ match += 1
+ # validate data type: BoundingBoxResult
+ if not isinstance(v, BoundingBoxResult):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxResult`")
+ else:
+ match += 1
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in ImageQueryResult with oneOf schemas:"
+ " BinaryClassificationResult, BoundingBoxResult, CountingResult, MultiClassificationResult,"
+ " TextRecognitionResult. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when setting `actual_instance` in ImageQueryResult with oneOf schemas:"
+ " BinaryClassificationResult, BoundingBoxResult, CountingResult, MultiClassificationResult,"
+ " TextRecognitionResult. Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ImageQueryResult:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ImageQueryResult:
+ """Returns the object represented by the json string"""
+ instance = ImageQueryResult.construct()
+ if json_str is None:
+ return instance
+
+ error_messages = []
+ match = 0
+
+ # deserialize data into BinaryClassificationResult
+ try:
+ instance.actual_instance = BinaryClassificationResult.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into CountingResult
+ try:
+ instance.actual_instance = CountingResult.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into MultiClassificationResult
+ try:
+ instance.actual_instance = MultiClassificationResult.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into TextRecognitionResult
+ try:
+ instance.actual_instance = TextRecognitionResult.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into BoundingBoxResult
+ try:
+ instance.actual_instance = BoundingBoxResult.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into ImageQueryResult with oneOf schemas:"
+ " BinaryClassificationResult, BoundingBoxResult, CountingResult, MultiClassificationResult,"
+ " TextRecognitionResult. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when deserializing the JSON string into ImageQueryResult with oneOf schemas:"
+ " BinaryClassificationResult, BoundingBoxResult, CountingResult, MultiClassificationResult,"
+ " TextRecognitionResult. Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ to_json = getattr(self.actual_instance, "to_json", None)
+ if callable(to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ to_dict = getattr(self.actual_instance, "to_dict", None)
+ if callable(to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
+
+ def __getattr__(self, name):
+ try:
+ return super().__getattribute__(name)
+ except AttributeError:
+ return self.actual_instance.__getattribute__(name)
diff --git a/generated/groundlight_openapi_client/models/image_query_type_enum.py b/generated/groundlight_openapi_client/models/image_query_type_enum.py
new file mode 100644
index 00000000..3115bba9
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/image_query_type_enum.py
@@ -0,0 +1,35 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class ImageQueryTypeEnum(str, Enum):
+ """
+ ImageQueryTypeEnum
+ """
+
+ """
+ allowed enum values
+ """
+ IMAGE_QUERY = "image_query"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ImageQueryTypeEnum:
+ """Create an instance of ImageQueryTypeEnum from a JSON string"""
+ return ImageQueryTypeEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/label.py b/generated/groundlight_openapi_client/models/label.py
new file mode 100644
index 00000000..3dfbf71d
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/label.py
@@ -0,0 +1,37 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class Label(str, Enum):
+ """
+ Label
+ """
+
+ """
+ allowed enum values
+ """
+ YES = "YES"
+ NO = "NO"
+ UNCLEAR = "UNCLEAR"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Label:
+ """Create an instance of Label from a JSON string"""
+ return Label(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/label_value.py b/generated/groundlight_openapi_client/models/label_value.py
new file mode 100644
index 00000000..9a2031af
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/label_value.py
@@ -0,0 +1,140 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import List, Optional, Union
+from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist
+from groundlight_openapi_client.models.roi import ROI
+
+
+class LabelValue(BaseModel):
+ """
+ LabelValue
+ """
+
+ confidence: Optional[Union[StrictFloat, StrictInt]] = Field(...)
+ class_name: Optional[StrictStr] = Field(
+ default=..., description="Return a human-readable class name for this label (e.g. YES/NO)"
+ )
+ rois: Optional[conlist(ROI)] = None
+ annotations_requested: conlist(StrictStr) = Field(...)
+ created_at: datetime = Field(...)
+ detector_id: Optional[StrictInt] = Field(...)
+ source: StrictStr = Field(...)
+ text: Optional[StrictStr] = Field(default=..., description="Text annotations")
+ __properties = [
+ "confidence",
+ "class_name",
+ "rois",
+ "annotations_requested",
+ "created_at",
+ "detector_id",
+ "source",
+ "text",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> LabelValue:
+ """Create an instance of LabelValue from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "confidence",
+ "class_name",
+ "annotations_requested",
+ "created_at",
+ "detector_id",
+ "source",
+ "text",
+ },
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of each item in rois (list)
+ _items = []
+ if self.rois:
+ for _item in self.rois:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["rois"] = _items
+ # set to None if confidence (nullable) is None
+ # and __fields_set__ contains the field
+ if self.confidence is None and "confidence" in self.__fields_set__:
+ _dict["confidence"] = None
+
+ # set to None if class_name (nullable) is None
+ # and __fields_set__ contains the field
+ if self.class_name is None and "class_name" in self.__fields_set__:
+ _dict["class_name"] = None
+
+ # set to None if rois (nullable) is None
+ # and __fields_set__ contains the field
+ if self.rois is None and "rois" in self.__fields_set__:
+ _dict["rois"] = None
+
+ # set to None if detector_id (nullable) is None
+ # and __fields_set__ contains the field
+ if self.detector_id is None and "detector_id" in self.__fields_set__:
+ _dict["detector_id"] = None
+
+ # set to None if text (nullable) is None
+ # and __fields_set__ contains the field
+ if self.text is None and "text" in self.__fields_set__:
+ _dict["text"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> LabelValue:
+ """Create an instance of LabelValue from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return LabelValue.parse_obj(obj)
+
+ _obj = LabelValue.parse_obj({
+ "confidence": obj.get("confidence"),
+ "class_name": obj.get("class_name"),
+ "rois": [ROI.from_dict(_item) for _item in obj.get("rois")] if obj.get("rois") is not None else None,
+ "annotations_requested": obj.get("annotations_requested"),
+ "created_at": obj.get("created_at"),
+ "detector_id": obj.get("detector_id"),
+ "source": obj.get("source"),
+ "text": obj.get("text"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/label_value_request.py b/generated/groundlight_openapi_client/models/label_value_request.py
new file mode 100644
index 00000000..b4d08445
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/label_value_request.py
@@ -0,0 +1,92 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictStr, conlist, constr
+from groundlight_openapi_client.models.roi_request import ROIRequest
+
+
+class LabelValueRequest(BaseModel):
+ """
+ LabelValueRequest
+ """
+
+ label: Optional[StrictStr] = Field(...)
+ image_query_id: constr(strict=True, min_length=1) = Field(...)
+ rois: Optional[conlist(ROIRequest)] = None
+ __properties = ["label", "image_query_id", "rois"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> LabelValueRequest:
+ """Create an instance of LabelValueRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in rois (list)
+ _items = []
+ if self.rois:
+ for _item in self.rois:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["rois"] = _items
+ # set to None if label (nullable) is None
+ # and __fields_set__ contains the field
+ if self.label is None and "label" in self.__fields_set__:
+ _dict["label"] = None
+
+ # set to None if rois (nullable) is None
+ # and __fields_set__ contains the field
+ if self.rois is None and "rois" in self.__fields_set__:
+ _dict["rois"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> LabelValueRequest:
+ """Create an instance of LabelValueRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return LabelValueRequest.parse_obj(obj)
+
+ _obj = LabelValueRequest.parse_obj({
+ "label": obj.get("label"),
+ "image_query_id": obj.get("image_query_id"),
+ "rois": [ROIRequest.from_dict(_item) for _item in obj.get("rois")] if obj.get("rois") is not None else None,
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/mode_enum.py b/generated/groundlight_openapi_client/models/mode_enum.py
new file mode 100644
index 00000000..bc1b2bbe
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/mode_enum.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class ModeEnum(str, Enum):
+ """
+ ModeEnum
+ """
+
+ """
+ allowed enum values
+ """
+ BINARY = "BINARY"
+ COUNT = "COUNT"
+ MULTI_CLASS = "MULTI_CLASS"
+ TEXT = "TEXT"
+ BOUNDING_BOX = "BOUNDING_BOX"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ModeEnum:
+ """Create an instance of ModeEnum from a JSON string"""
+ return ModeEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/multi_class_mode_configuration.py b/generated/groundlight_openapi_client/models/multi_class_mode_configuration.py
new file mode 100644
index 00000000..02d71f99
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/multi_class_mode_configuration.py
@@ -0,0 +1,71 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+
+
+class MultiClassModeConfiguration(BaseModel):
+ """
+ MultiClassModeConfiguration
+ """
+
+ class_names: conlist(StrictStr) = Field(...)
+ num_classes: Optional[StrictInt] = None
+ __properties = ["class_names", "num_classes"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MultiClassModeConfiguration:
+ """Create an instance of MultiClassModeConfiguration from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MultiClassModeConfiguration:
+ """Create an instance of MultiClassModeConfiguration from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MultiClassModeConfiguration.parse_obj(obj)
+
+ _obj = MultiClassModeConfiguration.parse_obj(
+ {"class_names": obj.get("class_names"), "num_classes": obj.get("num_classes")}
+ )
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/multi_classification_result.py b/generated/groundlight_openapi_client/models/multi_classification_result.py
new file mode 100644
index 00000000..d6916cb6
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/multi_classification_result.py
@@ -0,0 +1,93 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictStr, confloat, conint, validator
+
+
+class MultiClassificationResult(BaseModel):
+ """
+ MultiClassificationResult
+ """
+
+ confidence: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = None
+ source: Optional[StrictStr] = None
+ result_type: Optional[StrictStr] = None
+ from_edge: Optional[StrictBool] = None
+ label: StrictStr = Field(...)
+ __properties = ["confidence", "source", "result_type", "from_edge", "label"]
+
+ @validator("result_type")
+ def result_type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in ("multi_classification",):
+ raise ValueError("must be one of enum values ('multi_classification')")
+ return value
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> MultiClassificationResult:
+ """Create an instance of MultiClassificationResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if confidence (nullable) is None
+ # and __fields_set__ contains the field
+ if self.confidence is None and "confidence" in self.__fields_set__:
+ _dict["confidence"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> MultiClassificationResult:
+ """Create an instance of MultiClassificationResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return MultiClassificationResult.parse_obj(obj)
+
+ _obj = MultiClassificationResult.parse_obj({
+ "confidence": obj.get("confidence"),
+ "source": obj.get("source"),
+ "result_type": obj.get("result_type"),
+ "from_edge": obj.get("from_edge"),
+ "label": obj.get("label"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/note.py b/generated/groundlight_openapi_client/models/note.py
new file mode 100644
index 00000000..43adc26d
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/note.py
@@ -0,0 +1,88 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBool, StrictStr
+
+
+class Note(BaseModel):
+ """
+ Note
+ """
+
+ detector_id: StrictStr = Field(...)
+ content: Optional[StrictStr] = Field(default=None, description="Text content of the note.")
+ is_pinned: Optional[StrictBool] = None
+ __properties = ["detector_id", "content", "is_pinned"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Note:
+ """Create an instance of Note from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "detector_id",
+ },
+ exclude_none=True,
+ )
+ # set to None if content (nullable) is None
+ # and __fields_set__ contains the field
+ if self.content is None and "content" in self.__fields_set__:
+ _dict["content"] = None
+
+ # set to None if is_pinned (nullable) is None
+ # and __fields_set__ contains the field
+ if self.is_pinned is None and "is_pinned" in self.__fields_set__:
+ _dict["is_pinned"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Note:
+ """Create an instance of Note from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Note.parse_obj(obj)
+
+ _obj = Note.parse_obj(
+ {"detector_id": obj.get("detector_id"), "content": obj.get("content"), "is_pinned": obj.get("is_pinned")}
+ )
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/note_request.py b/generated/groundlight_openapi_client/models/note_request.py
new file mode 100644
index 00000000..63d64661
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/note_request.py
@@ -0,0 +1,87 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictBytes, StrictStr
+
+
+class NoteRequest(BaseModel):
+ """
+ NoteRequest
+ """
+
+ content: Optional[StrictStr] = Field(default=None, description="Text content of the note.")
+ is_pinned: Optional[StrictBool] = None
+ image: Optional[Union[StrictBytes, StrictStr]] = None
+ __properties = ["content", "is_pinned", "image"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> NoteRequest:
+ """Create an instance of NoteRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if content (nullable) is None
+ # and __fields_set__ contains the field
+ if self.content is None and "content" in self.__fields_set__:
+ _dict["content"] = None
+
+ # set to None if is_pinned (nullable) is None
+ # and __fields_set__ contains the field
+ if self.is_pinned is None and "is_pinned" in self.__fields_set__:
+ _dict["is_pinned"] = None
+
+ # set to None if image (nullable) is None
+ # and __fields_set__ contains the field
+ if self.image is None and "image" in self.__fields_set__:
+ _dict["image"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> NoteRequest:
+ """Create an instance of NoteRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return NoteRequest.parse_obj(obj)
+
+ _obj = NoteRequest.parse_obj(
+ {"content": obj.get("content"), "is_pinned": obj.get("is_pinned"), "image": obj.get("image")}
+ )
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/paginated_detector_list.py b/generated/groundlight_openapi_client/models/paginated_detector_list.py
new file mode 100644
index 00000000..c927dd6a
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/paginated_detector_list.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from groundlight_openapi_client.models.detector import Detector
+
+
+class PaginatedDetectorList(BaseModel):
+ """
+ PaginatedDetectorList
+ """
+
+ count: StrictInt = Field(...)
+ next: Optional[StrictStr] = None
+ previous: Optional[StrictStr] = None
+ results: conlist(Detector) = Field(...)
+ __properties = ["count", "next", "previous", "results"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PaginatedDetectorList:
+ """Create an instance of PaginatedDetectorList from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
+ _items = []
+ if self.results:
+ for _item in self.results:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["results"] = _items
+ # set to None if next (nullable) is None
+ # and __fields_set__ contains the field
+ if self.next is None and "next" in self.__fields_set__:
+ _dict["next"] = None
+
+ # set to None if previous (nullable) is None
+ # and __fields_set__ contains the field
+ if self.previous is None and "previous" in self.__fields_set__:
+ _dict["previous"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> PaginatedDetectorList:
+ """Create an instance of PaginatedDetectorList from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return PaginatedDetectorList.parse_obj(obj)
+
+ _obj = PaginatedDetectorList.parse_obj({
+ "count": obj.get("count"),
+ "next": obj.get("next"),
+ "previous": obj.get("previous"),
+ "results": (
+ [Detector.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None
+ ),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/paginated_image_query_list.py b/generated/groundlight_openapi_client/models/paginated_image_query_list.py
new file mode 100644
index 00000000..1755d6a3
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/paginated_image_query_list.py
@@ -0,0 +1,98 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from groundlight_openapi_client.models.image_query import ImageQuery
+
+
+class PaginatedImageQueryList(BaseModel):
+ """
+ PaginatedImageQueryList
+ """
+
+ count: StrictInt = Field(...)
+ next: Optional[StrictStr] = None
+ previous: Optional[StrictStr] = None
+ results: conlist(ImageQuery) = Field(...)
+ __properties = ["count", "next", "previous", "results"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PaginatedImageQueryList:
+ """Create an instance of PaginatedImageQueryList from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
+ _items = []
+ if self.results:
+ for _item in self.results:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["results"] = _items
+ # set to None if next (nullable) is None
+ # and __fields_set__ contains the field
+ if self.next is None and "next" in self.__fields_set__:
+ _dict["next"] = None
+
+ # set to None if previous (nullable) is None
+ # and __fields_set__ contains the field
+ if self.previous is None and "previous" in self.__fields_set__:
+ _dict["previous"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> PaginatedImageQueryList:
+ """Create an instance of PaginatedImageQueryList from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return PaginatedImageQueryList.parse_obj(obj)
+
+ _obj = PaginatedImageQueryList.parse_obj({
+ "count": obj.get("count"),
+ "next": obj.get("next"),
+ "previous": obj.get("previous"),
+ "results": (
+ [ImageQuery.from_dict(_item) for _item in obj.get("results")]
+ if obj.get("results") is not None
+ else None
+ ),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/paginated_rule_list.py b/generated/groundlight_openapi_client/models/paginated_rule_list.py
new file mode 100644
index 00000000..4999aee7
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/paginated_rule_list.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictInt, StrictStr, conlist
+from groundlight_openapi_client.models.rule import Rule
+
+
+class PaginatedRuleList(BaseModel):
+ """
+ PaginatedRuleList
+ """
+
+ count: StrictInt = Field(...)
+ next: Optional[StrictStr] = None
+ previous: Optional[StrictStr] = None
+ results: conlist(Rule) = Field(...)
+ __properties = ["count", "next", "previous", "results"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PaginatedRuleList:
+ """Create an instance of PaginatedRuleList from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
+ _items = []
+ if self.results:
+ for _item in self.results:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["results"] = _items
+ # set to None if next (nullable) is None
+ # and __fields_set__ contains the field
+ if self.next is None and "next" in self.__fields_set__:
+ _dict["next"] = None
+
+ # set to None if previous (nullable) is None
+ # and __fields_set__ contains the field
+ if self.previous is None and "previous" in self.__fields_set__:
+ _dict["previous"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> PaginatedRuleList:
+ """Create an instance of PaginatedRuleList from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return PaginatedRuleList.parse_obj(obj)
+
+ _obj = PaginatedRuleList.parse_obj({
+ "count": obj.get("count"),
+ "next": obj.get("next"),
+ "previous": obj.get("previous"),
+ "results": (
+ [Rule.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None
+ ),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/patched_detector_request.py b/generated/groundlight_openapi_client/models/patched_detector_request.py
new file mode 100644
index 00000000..88b2646d
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/patched_detector_request.py
@@ -0,0 +1,96 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, confloat, conint, constr
+from groundlight_openapi_client.models.detector_status import DetectorStatus
+
+
+class PatchedDetectorRequest(BaseModel):
+ """
+ Groundlight Detectors provide answers to natural language questions about images. Each detector can answer a single question, and multiple detectors can be strung together for more complex logic. Detectors can be created through the create_detector method, or through the create_[MODE]_detector methods for pro tier users # noqa: E501
+ """
+
+ name: Optional[constr(strict=True, max_length=200, min_length=1)] = Field(
+ default=None, description="A short, descriptive name for the detector."
+ )
+ confidence_threshold: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = (
+ Field(
+ default=0.9,
+ description=(
+ "If the detector's prediction is below this confidence threshold, send the image query for human"
+ " review."
+ ),
+ )
+ )
+ patience_time: Optional[Union[confloat(le=3600, ge=0, strict=True), conint(le=3600, ge=0, strict=True)]] = Field(
+ default=30.0, description="How long Groundlight will attempt to generate a confident prediction"
+ )
+ status: Optional[DetectorStatus] = None
+ escalation_type: Optional[constr(strict=True, min_length=1)] = None
+ __properties = ["name", "confidence_threshold", "patience_time", "status", "escalation_type"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PatchedDetectorRequest:
+ """Create an instance of PatchedDetectorRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of status
+ if self.status:
+ _dict["status"] = self.status.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> PatchedDetectorRequest:
+ """Create an instance of PatchedDetectorRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return PatchedDetectorRequest.parse_obj(obj)
+
+ _obj = PatchedDetectorRequest.parse_obj({
+ "name": obj.get("name"),
+ "confidence_threshold": (
+ obj.get("confidence_threshold") if obj.get("confidence_threshold") is not None else 0.9
+ ),
+ "patience_time": obj.get("patience_time") if obj.get("patience_time") is not None else 30.0,
+ "status": DetectorStatus.from_dict(obj.get("status")) if obj.get("status") is not None else None,
+ "escalation_type": obj.get("escalation_type"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/payload_template.py b/generated/groundlight_openapi_client/models/payload_template.py
new file mode 100644
index 00000000..cc4cd88c
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/payload_template.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Dict, Optional
+from pydantic import BaseModel, Field, StrictStr
+
+
+class PayloadTemplate(BaseModel):
+ """
+ PayloadTemplate
+ """
+
+ template: StrictStr = Field(...)
+ headers: Optional[Dict[str, StrictStr]] = None
+ __properties = ["template", "headers"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PayloadTemplate:
+ """Create an instance of PayloadTemplate from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if headers (nullable) is None
+ # and __fields_set__ contains the field
+ if self.headers is None and "headers" in self.__fields_set__:
+ _dict["headers"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> PayloadTemplate:
+ """Create an instance of PayloadTemplate from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return PayloadTemplate.parse_obj(obj)
+
+ _obj = PayloadTemplate.parse_obj({"template": obj.get("template"), "headers": obj.get("headers")})
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/payload_template_request.py b/generated/groundlight_openapi_client/models/payload_template_request.py
new file mode 100644
index 00000000..efdf39e6
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/payload_template_request.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Dict, Optional
+from pydantic import BaseModel, Field, constr
+
+
+class PayloadTemplateRequest(BaseModel):
+ """
+ PayloadTemplateRequest
+ """
+
+ template: constr(strict=True, min_length=1) = Field(...)
+ headers: Optional[Dict[str, constr(strict=True, min_length=1)]] = None
+ __properties = ["template", "headers"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> PayloadTemplateRequest:
+ """Create an instance of PayloadTemplateRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if headers (nullable) is None
+ # and __fields_set__ contains the field
+ if self.headers is None and "headers" in self.__fields_set__:
+ _dict["headers"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> PayloadTemplateRequest:
+ """Create an instance of PayloadTemplateRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return PayloadTemplateRequest.parse_obj(obj)
+
+ _obj = PayloadTemplateRequest.parse_obj({"template": obj.get("template"), "headers": obj.get("headers")})
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/result_type_enum.py b/generated/groundlight_openapi_client/models/result_type_enum.py
new file mode 100644
index 00000000..062c6237
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/result_type_enum.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class ResultTypeEnum(str, Enum):
+ """
+ ResultTypeEnum
+ """
+
+ """
+ allowed enum values
+ """
+ BINARY_CLASSIFICATION = "binary_classification"
+ COUNTING = "counting"
+ MULTI_CLASSIFICATION = "multi_classification"
+ TEXT_RECOGNITION = "text_recognition"
+ BOUNDING_BOX = "bounding_box"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ResultTypeEnum:
+ """Create an instance of ResultTypeEnum from a JSON string"""
+ return ResultTypeEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/roi.py b/generated/groundlight_openapi_client/models/roi.py
new file mode 100644
index 00000000..1e7e8761
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/roi.py
@@ -0,0 +1,84 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Union
+from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr
+from groundlight_openapi_client.models.b_box_geometry import BBoxGeometry
+
+
+class ROI(BaseModel):
+ """
+ Mixin for serializers to handle data in the StrictBaseModel format # noqa: E501
+ """
+
+ label: StrictStr = Field(default=..., description="The label of the bounding box.")
+ score: Union[StrictFloat, StrictInt] = Field(default=..., description="The confidence of the bounding box.")
+ geometry: BBoxGeometry = Field(...)
+ __properties = ["label", "score", "geometry"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ROI:
+ """Create an instance of ROI from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "score",
+ },
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of geometry
+ if self.geometry:
+ _dict["geometry"] = self.geometry.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ROI:
+ """Create an instance of ROI from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ROI.parse_obj(obj)
+
+ _obj = ROI.parse_obj({
+ "label": obj.get("label"),
+ "score": obj.get("score"),
+ "geometry": BBoxGeometry.from_dict(obj.get("geometry")) if obj.get("geometry") is not None else None,
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/roi_request.py b/generated/groundlight_openapi_client/models/roi_request.py
new file mode 100644
index 00000000..9a5e720f
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/roi_request.py
@@ -0,0 +1,75 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from pydantic import BaseModel, Field, constr
+from groundlight_openapi_client.models.b_box_geometry_request import BBoxGeometryRequest
+
+
+class ROIRequest(BaseModel):
+ """
+ Mixin for serializers to handle data in the StrictBaseModel format # noqa: E501
+ """
+
+ label: constr(strict=True, min_length=1) = Field(default=..., description="The label of the bounding box.")
+ geometry: BBoxGeometryRequest = Field(...)
+ __properties = ["label", "geometry"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> ROIRequest:
+ """Create an instance of ROIRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of geometry
+ if self.geometry:
+ _dict["geometry"] = self.geometry.to_dict()
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> ROIRequest:
+ """Create an instance of ROIRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return ROIRequest.parse_obj(obj)
+
+ _obj = ROIRequest.parse_obj({
+ "label": obj.get("label"),
+ "geometry": BBoxGeometryRequest.from_dict(obj.get("geometry")) if obj.get("geometry") is not None else None,
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/rule.py b/generated/groundlight_openapi_client/models/rule.py
new file mode 100644
index 00000000..2d9125b5
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/rule.py
@@ -0,0 +1,138 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conint, conlist, constr
+from groundlight_openapi_client.models.condition import Condition
+from groundlight_openapi_client.models.rule_action import RuleAction
+from groundlight_openapi_client.models.snooze_time_unit_enum import SnoozeTimeUnitEnum
+from groundlight_openapi_client.models.webhook_action import WebhookAction
+
+
+class Rule(BaseModel):
+ """
+ Rule
+ """
+
+ id: StrictInt = Field(...)
+ detector_id: StrictStr = Field(...)
+ detector_name: StrictStr = Field(...)
+ name: constr(strict=True, max_length=44) = Field(...)
+ enabled: Optional[StrictBool] = True
+ snooze_time_enabled: Optional[StrictBool] = False
+ snooze_time_value: Optional[conint(strict=True, ge=0)] = 0
+ snooze_time_unit: Optional[SnoozeTimeUnitEnum] = None
+ human_review_required: Optional[StrictBool] = False
+ condition: Condition = Field(...)
+ action: Optional[RuleAction] = None
+ webhook_action: Optional[conlist(WebhookAction)] = None
+ __properties = [
+ "id",
+ "detector_id",
+ "detector_name",
+ "name",
+ "enabled",
+ "snooze_time_enabled",
+ "snooze_time_value",
+ "snooze_time_unit",
+ "human_review_required",
+ "condition",
+ "action",
+ "webhook_action",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Rule:
+ """Create an instance of Rule from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(
+ by_alias=True,
+ exclude={
+ "id",
+ "detector_id",
+ "detector_name",
+ },
+ exclude_none=True,
+ )
+ # override the default output from pydantic by calling `to_dict()` of condition
+ if self.condition:
+ _dict["condition"] = self.condition.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of action
+ if self.action:
+ _dict["action"] = self.action.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in webhook_action (list)
+ _items = []
+ if self.webhook_action:
+ for _item in self.webhook_action:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["webhook_action"] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> Rule:
+ """Create an instance of Rule from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return Rule.parse_obj(obj)
+
+ _obj = Rule.parse_obj({
+ "id": obj.get("id"),
+ "detector_id": obj.get("detector_id"),
+ "detector_name": obj.get("detector_name"),
+ "name": obj.get("name"),
+ "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
+ "snooze_time_enabled": (
+ obj.get("snooze_time_enabled") if obj.get("snooze_time_enabled") is not None else False
+ ),
+ "snooze_time_value": obj.get("snooze_time_value") if obj.get("snooze_time_value") is not None else 0,
+ "snooze_time_unit": obj.get("snooze_time_unit"),
+ "human_review_required": (
+ obj.get("human_review_required") if obj.get("human_review_required") is not None else False
+ ),
+ "condition": Condition.from_dict(obj.get("condition")) if obj.get("condition") is not None else None,
+ "action": RuleAction.from_dict(obj.get("action")) if obj.get("action") is not None else None,
+ "webhook_action": (
+ [WebhookAction.from_dict(_item) for _item in obj.get("webhook_action")]
+ if obj.get("webhook_action") is not None
+ else None
+ ),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/rule_action.py b/generated/groundlight_openapi_client/models/rule_action.py
new file mode 100644
index 00000000..fc28e0e0
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/rule_action.py
@@ -0,0 +1,161 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+from inspect import getfullargspec
+import json
+import pprint
+import re # noqa: F401
+
+from typing import Any, List, Optional
+from pydantic import BaseModel, Field, StrictStr, ValidationError, conlist, validator
+from groundlight_openapi_client.models.action import Action
+from typing import Union, Any, List, TYPE_CHECKING
+from pydantic import StrictStr, Field
+
+RULEACTION_ONE_OF_SCHEMAS = ["Action", "List[Action]"]
+
+
+class RuleAction(BaseModel):
+ """
+ RuleAction
+ """
+
+ # data type: Action
+ oneof_schema_1_validator: Optional[Action] = None
+ # data type: List[Action]
+ oneof_schema_2_validator: Optional[conlist(Action)] = None
+ if TYPE_CHECKING:
+ actual_instance: Union[Action, List[Action]]
+ else:
+ actual_instance: Any
+ one_of_schemas: List[str] = Field(RULEACTION_ONE_OF_SCHEMAS, const=True)
+
+ class Config:
+ validate_assignment = True
+
+ def __init__(self, *args, **kwargs) -> None:
+ if args:
+ if len(args) > 1:
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
+ if kwargs:
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
+ super().__init__(actual_instance=args[0])
+ else:
+ super().__init__(**kwargs)
+
+ @validator("actual_instance")
+ def actual_instance_must_validate_oneof(cls, v):
+ instance = RuleAction.construct()
+ error_messages = []
+ match = 0
+ # validate data type: Action
+ if not isinstance(v, Action):
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Action`")
+ else:
+ match += 1
+ # validate data type: List[Action]
+ try:
+ instance.oneof_schema_2_validator = v
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when setting `actual_instance` in RuleAction with oneOf schemas: Action,"
+ " List[Action]. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when setting `actual_instance` in RuleAction with oneOf schemas: Action, List[Action]."
+ " Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return v
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> RuleAction:
+ return cls.from_json(json.dumps(obj))
+
+ @classmethod
+ def from_json(cls, json_str: str) -> RuleAction:
+ """Returns the object represented by the json string"""
+ instance = RuleAction.construct()
+ error_messages = []
+ match = 0
+
+ # deserialize data into Action
+ try:
+ instance.actual_instance = Action.from_json(json_str)
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+ # deserialize data into List[Action]
+ try:
+ # validation
+ instance.oneof_schema_2_validator = json.loads(json_str)
+ # assign value to actual_instance
+ instance.actual_instance = instance.oneof_schema_2_validator
+ match += 1
+ except (ValidationError, ValueError) as e:
+ error_messages.append(str(e))
+
+ if match > 1:
+ # more than 1 match
+ raise ValueError(
+ "Multiple matches found when deserializing the JSON string into RuleAction with oneOf schemas: Action,"
+ " List[Action]. Details: "
+ + ", ".join(error_messages)
+ )
+ elif match == 0:
+ # no match
+ raise ValueError(
+ "No match found when deserializing the JSON string into RuleAction with oneOf schemas: Action,"
+ " List[Action]. Details: "
+ + ", ".join(error_messages)
+ )
+ else:
+ return instance
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the actual instance"""
+ if self.actual_instance is None:
+ return "null"
+
+ to_json = getattr(self.actual_instance, "to_json", None)
+ if callable(to_json):
+ return self.actual_instance.to_json()
+ else:
+ return json.dumps(self.actual_instance)
+
+ def to_dict(self) -> dict:
+ """Returns the dict representation of the actual instance"""
+ if self.actual_instance is None:
+ return None
+
+ to_dict = getattr(self.actual_instance, "to_dict", None)
+ if callable(to_dict):
+ return self.actual_instance.to_dict()
+ else:
+ # primitive type
+ return self.actual_instance
+
+ def to_str(self) -> str:
+ """Returns the string representation of the actual instance"""
+ return pprint.pformat(self.dict())
diff --git a/generated/groundlight_openapi_client/models/rule_request.py b/generated/groundlight_openapi_client/models/rule_request.py
new file mode 100644
index 00000000..09aeac65
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/rule_request.py
@@ -0,0 +1,121 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import List, Optional
+from pydantic import BaseModel, Field, StrictBool, conint, conlist, constr
+from groundlight_openapi_client.models.condition_request import ConditionRequest
+from groundlight_openapi_client.models.rule_action import RuleAction
+from groundlight_openapi_client.models.snooze_time_unit_enum import SnoozeTimeUnitEnum
+from groundlight_openapi_client.models.webhook_action_request import WebhookActionRequest
+
+
+class RuleRequest(BaseModel):
+ """
+ RuleRequest
+ """
+
+ name: constr(strict=True, max_length=44, min_length=1) = Field(...)
+ enabled: Optional[StrictBool] = True
+ snooze_time_enabled: Optional[StrictBool] = False
+ snooze_time_value: Optional[conint(strict=True, ge=0)] = 0
+ snooze_time_unit: Optional[SnoozeTimeUnitEnum] = None
+ human_review_required: Optional[StrictBool] = False
+ condition: ConditionRequest = Field(...)
+ action: Optional[RuleAction] = None
+ webhook_action: Optional[conlist(WebhookActionRequest)] = None
+ __properties = [
+ "name",
+ "enabled",
+ "snooze_time_enabled",
+ "snooze_time_value",
+ "snooze_time_unit",
+ "human_review_required",
+ "condition",
+ "action",
+ "webhook_action",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> RuleRequest:
+ """Create an instance of RuleRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of condition
+ if self.condition:
+ _dict["condition"] = self.condition.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of action
+ if self.action:
+ _dict["action"] = self.action.to_dict()
+ # override the default output from pydantic by calling `to_dict()` of each item in webhook_action (list)
+ _items = []
+ if self.webhook_action:
+ for _item in self.webhook_action:
+ if _item:
+ _items.append(_item.to_dict())
+ _dict["webhook_action"] = _items
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> RuleRequest:
+ """Create an instance of RuleRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return RuleRequest.parse_obj(obj)
+
+ _obj = RuleRequest.parse_obj({
+ "name": obj.get("name"),
+ "enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
+ "snooze_time_enabled": (
+ obj.get("snooze_time_enabled") if obj.get("snooze_time_enabled") is not None else False
+ ),
+ "snooze_time_value": obj.get("snooze_time_value") if obj.get("snooze_time_value") is not None else 0,
+ "snooze_time_unit": obj.get("snooze_time_unit"),
+ "human_review_required": (
+ obj.get("human_review_required") if obj.get("human_review_required") is not None else False
+ ),
+ "condition": ConditionRequest.from_dict(obj.get("condition")) if obj.get("condition") is not None else None,
+ "action": RuleAction.from_dict(obj.get("action")) if obj.get("action") is not None else None,
+ "webhook_action": (
+ [WebhookActionRequest.from_dict(_item) for _item in obj.get("webhook_action")]
+ if obj.get("webhook_action") is not None
+ else None
+ ),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/snooze_time_unit_enum.py b/generated/groundlight_openapi_client/models/snooze_time_unit_enum.py
new file mode 100644
index 00000000..c4920a84
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/snooze_time_unit_enum.py
@@ -0,0 +1,38 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class SnoozeTimeUnitEnum(str, Enum):
+ """
+ * `DAYS` - DAYS * `HOURS` - HOURS * `MINUTES` - MINUTES * `SECONDS` - SECONDS
+ """
+
+ """
+ allowed enum values
+ """
+ DAYS = "DAYS"
+ HOURS = "HOURS"
+ MINUTES = "MINUTES"
+ SECONDS = "SECONDS"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SnoozeTimeUnitEnum:
+ """Create an instance of SnoozeTimeUnitEnum from a JSON string"""
+ return SnoozeTimeUnitEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/source.py b/generated/groundlight_openapi_client/models/source.py
new file mode 100644
index 00000000..eab0022c
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/source.py
@@ -0,0 +1,40 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class Source(str, Enum):
+ """
+ Source
+ """
+
+ """
+ allowed enum values
+ """
+ STILL_PROCESSING = "STILL_PROCESSING"
+ CLOUD = "CLOUD"
+ USER = "USER"
+ CLOUD_ENSEMBLE = "CLOUD_ENSEMBLE"
+ ALGORITHM = "ALGORITHM"
+ EDGE = "EDGE"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> Source:
+ """Create an instance of Source from a JSON string"""
+ return Source(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/source_enum.py b/generated/groundlight_openapi_client/models/source_enum.py
new file mode 100644
index 00000000..d5f95b83
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/source_enum.py
@@ -0,0 +1,42 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class SourceEnum(str, Enum):
+ """
+ SourceEnum
+ """
+
+ """
+ allowed enum values
+ """
+ INITIAL_PLACEHOLDER = "INITIAL_PLACEHOLDER"
+ CLOUD = "CLOUD"
+ CUST = "CUST"
+ HUMAN_CLOUD_ENSEMBLE = "HUMAN_CLOUD_ENSEMBLE"
+ ALG = "ALG"
+ ALG_REC = "ALG_REC"
+ ALG_UNCLEAR = "ALG_UNCLEAR"
+ EDGE = "EDGE"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> SourceEnum:
+ """Create an instance of SourceEnum from a JSON string"""
+ return SourceEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/status_enum.py b/generated/groundlight_openapi_client/models/status_enum.py
new file mode 100644
index 00000000..7344ca59
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/status_enum.py
@@ -0,0 +1,36 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class StatusEnum(str, Enum):
+ """
+ * `ON` - ON * `OFF` - OFF
+ """
+
+ """
+ allowed enum values
+ """
+ ON = "ON"
+ OFF = "OFF"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> StatusEnum:
+ """Create an instance of StatusEnum from a JSON string"""
+ return StatusEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/text_mode_configuration.py b/generated/groundlight_openapi_client/models/text_mode_configuration.py
new file mode 100644
index 00000000..03e99147
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/text_mode_configuration.py
@@ -0,0 +1,68 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, conint
+
+
+class TextModeConfiguration(BaseModel):
+ """
+ TextModeConfiguration
+ """
+
+ value_max_length: Optional[conint(strict=True, le=250, ge=1)] = None
+ __properties = ["value_max_length"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TextModeConfiguration:
+ """Create an instance of TextModeConfiguration from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TextModeConfiguration:
+ """Create an instance of TextModeConfiguration from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TextModeConfiguration.parse_obj(obj)
+
+ _obj = TextModeConfiguration.parse_obj({"value_max_length": obj.get("value_max_length")})
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/text_recognition_result.py b/generated/groundlight_openapi_client/models/text_recognition_result.py
new file mode 100644
index 00000000..462f8dcd
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/text_recognition_result.py
@@ -0,0 +1,100 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional, Union
+from pydantic import BaseModel, Field, StrictBool, StrictStr, confloat, conint, validator
+
+
+class TextRecognitionResult(BaseModel):
+ """
+ TextRecognitionResult
+ """
+
+ confidence: Optional[Union[confloat(le=1.0, ge=0.0, strict=True), conint(le=1, ge=0, strict=True)]] = None
+ source: Optional[StrictStr] = None
+ result_type: Optional[StrictStr] = None
+ from_edge: Optional[StrictBool] = None
+ text: Optional[StrictStr] = Field(...)
+ truncated: StrictBool = Field(...)
+ __properties = ["confidence", "source", "result_type", "from_edge", "text", "truncated"]
+
+ @validator("result_type")
+ def result_type_validate_enum(cls, value):
+ """Validates the enum"""
+ if value is None:
+ return value
+
+ if value not in ("text_recognition",):
+ raise ValueError("must be one of enum values ('text_recognition')")
+ return value
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> TextRecognitionResult:
+ """Create an instance of TextRecognitionResult from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # set to None if confidence (nullable) is None
+ # and __fields_set__ contains the field
+ if self.confidence is None and "confidence" in self.__fields_set__:
+ _dict["confidence"] = None
+
+ # set to None if text (nullable) is None
+ # and __fields_set__ contains the field
+ if self.text is None and "text" in self.__fields_set__:
+ _dict["text"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> TextRecognitionResult:
+ """Create an instance of TextRecognitionResult from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return TextRecognitionResult.parse_obj(obj)
+
+ _obj = TextRecognitionResult.parse_obj({
+ "confidence": obj.get("confidence"),
+ "source": obj.get("source"),
+ "result_type": obj.get("result_type"),
+ "from_edge": obj.get("from_edge"),
+ "text": obj.get("text"),
+ "truncated": obj.get("truncated"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/verb_enum.py b/generated/groundlight_openapi_client/models/verb_enum.py
new file mode 100644
index 00000000..d14e73d9
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/verb_enum.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import json
+import pprint
+import re # noqa: F401
+from aenum import Enum, no_arg
+
+
+class VerbEnum(str, Enum):
+ """
+ VerbEnum
+ """
+
+ """
+ allowed enum values
+ """
+ ANSWERED_CONSECUTIVELY = "ANSWERED_CONSECUTIVELY"
+ ANSWERED_WITHIN_TIME = "ANSWERED_WITHIN_TIME"
+ CHANGED_TO = "CHANGED_TO"
+ NO_CHANGE = "NO_CHANGE"
+ NO_QUERIES = "NO_QUERIES"
+
+ @classmethod
+ def from_json(cls, json_str: str) -> VerbEnum:
+ """Create an instance of VerbEnum from a JSON string"""
+ return VerbEnum(json.loads(json_str))
diff --git a/generated/groundlight_openapi_client/models/webhook_action.py b/generated/groundlight_openapi_client/models/webhook_action.py
new file mode 100644
index 00000000..5cc301e0
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/webhook_action.py
@@ -0,0 +1,110 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBool, StrictStr, constr
+from groundlight_openapi_client.models.payload_template import PayloadTemplate
+
+
+class WebhookAction(BaseModel):
+ """
+ WebhookAction
+ """
+
+ url: constr(strict=True, max_length=200) = Field(...)
+ include_image: Optional[StrictBool] = None
+ payload_template: Optional[PayloadTemplate] = None
+ last_message_failed: Optional[StrictBool] = None
+ last_failure_error: Optional[StrictStr] = None
+ last_failed_at: Optional[datetime] = None
+ __properties = [
+ "url",
+ "include_image",
+ "payload_template",
+ "last_message_failed",
+ "last_failure_error",
+ "last_failed_at",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> WebhookAction:
+ """Create an instance of WebhookAction from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of payload_template
+ if self.payload_template:
+ _dict["payload_template"] = self.payload_template.to_dict()
+ # set to None if payload_template (nullable) is None
+ # and __fields_set__ contains the field
+ if self.payload_template is None and "payload_template" in self.__fields_set__:
+ _dict["payload_template"] = None
+
+ # set to None if last_failure_error (nullable) is None
+ # and __fields_set__ contains the field
+ if self.last_failure_error is None and "last_failure_error" in self.__fields_set__:
+ _dict["last_failure_error"] = None
+
+ # set to None if last_failed_at (nullable) is None
+ # and __fields_set__ contains the field
+ if self.last_failed_at is None and "last_failed_at" in self.__fields_set__:
+ _dict["last_failed_at"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> WebhookAction:
+ """Create an instance of WebhookAction from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return WebhookAction.parse_obj(obj)
+
+ _obj = WebhookAction.parse_obj({
+ "url": obj.get("url"),
+ "include_image": obj.get("include_image"),
+ "payload_template": (
+ PayloadTemplate.from_dict(obj.get("payload_template"))
+ if obj.get("payload_template") is not None
+ else None
+ ),
+ "last_message_failed": obj.get("last_message_failed"),
+ "last_failure_error": obj.get("last_failure_error"),
+ "last_failed_at": obj.get("last_failed_at"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/webhook_action_request.py b/generated/groundlight_openapi_client/models/webhook_action_request.py
new file mode 100644
index 00000000..4a59ef97
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/webhook_action_request.py
@@ -0,0 +1,110 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+from datetime import datetime
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBool, StrictStr, constr
+from groundlight_openapi_client.models.payload_template_request import PayloadTemplateRequest
+
+
+class WebhookActionRequest(BaseModel):
+ """
+ WebhookActionRequest
+ """
+
+ url: constr(strict=True, max_length=200, min_length=1) = Field(...)
+ include_image: Optional[StrictBool] = None
+ payload_template: Optional[PayloadTemplateRequest] = None
+ last_message_failed: Optional[StrictBool] = None
+ last_failure_error: Optional[StrictStr] = None
+ last_failed_at: Optional[datetime] = None
+ __properties = [
+ "url",
+ "include_image",
+ "payload_template",
+ "last_message_failed",
+ "last_failure_error",
+ "last_failed_at",
+ ]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> WebhookActionRequest:
+ """Create an instance of WebhookActionRequest from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ # override the default output from pydantic by calling `to_dict()` of payload_template
+ if self.payload_template:
+ _dict["payload_template"] = self.payload_template.to_dict()
+ # set to None if payload_template (nullable) is None
+ # and __fields_set__ contains the field
+ if self.payload_template is None and "payload_template" in self.__fields_set__:
+ _dict["payload_template"] = None
+
+ # set to None if last_failure_error (nullable) is None
+ # and __fields_set__ contains the field
+ if self.last_failure_error is None and "last_failure_error" in self.__fields_set__:
+ _dict["last_failure_error"] = None
+
+ # set to None if last_failed_at (nullable) is None
+ # and __fields_set__ contains the field
+ if self.last_failed_at is None and "last_failed_at" in self.__fields_set__:
+ _dict["last_failed_at"] = None
+
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> WebhookActionRequest:
+ """Create an instance of WebhookActionRequest from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return WebhookActionRequest.parse_obj(obj)
+
+ _obj = WebhookActionRequest.parse_obj({
+ "url": obj.get("url"),
+ "include_image": obj.get("include_image"),
+ "payload_template": (
+ PayloadTemplateRequest.from_dict(obj.get("payload_template"))
+ if obj.get("payload_template") is not None
+ else None
+ ),
+ "last_message_failed": obj.get("last_message_failed"),
+ "last_failure_error": obj.get("last_failure_error"),
+ "last_failed_at": obj.get("last_failed_at"),
+ })
+ return _obj
diff --git a/generated/groundlight_openapi_client/models/who_am_i200_response.py b/generated/groundlight_openapi_client/models/who_am_i200_response.py
new file mode 100644
index 00000000..68f2672c
--- /dev/null
+++ b/generated/groundlight_openapi_client/models/who_am_i200_response.py
@@ -0,0 +1,72 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+from __future__ import annotations
+import pprint
+import re # noqa: F401
+import json
+
+
+from typing import Optional
+from pydantic import BaseModel, Field, StrictBool, StrictStr
+
+
+class WhoAmI200Response(BaseModel):
+ """
+ WhoAmI200Response
+ """
+
+ username: Optional[StrictStr] = Field(default=None, description="The user's username")
+ email: Optional[StrictStr] = Field(default=None, description="The user's email")
+ is_superuser: Optional[StrictBool] = Field(default=None, description="Whether the user is a superuser")
+ __properties = ["username", "email", "is_superuser"]
+
+ class Config:
+ """Pydantic configuration"""
+
+ allow_population_by_field_name = True
+ validate_assignment = True
+
+ def to_str(self) -> str:
+ """Returns the string representation of the model using alias"""
+ return pprint.pformat(self.dict(by_alias=True))
+
+ def to_json(self) -> str:
+ """Returns the JSON representation of the model using alias"""
+ return json.dumps(self.to_dict())
+
+ @classmethod
+ def from_json(cls, json_str: str) -> WhoAmI200Response:
+ """Create an instance of WhoAmI200Response from a JSON string"""
+ return cls.from_dict(json.loads(json_str))
+
+ def to_dict(self):
+ """Returns the dictionary representation of the model using alias"""
+ _dict = self.dict(by_alias=True, exclude={}, exclude_none=True)
+ return _dict
+
+ @classmethod
+ def from_dict(cls, obj: dict) -> WhoAmI200Response:
+ """Create an instance of WhoAmI200Response from a dict"""
+ if obj is None:
+ return None
+
+ if not isinstance(obj, dict):
+ return WhoAmI200Response.parse_obj(obj)
+
+ _obj = WhoAmI200Response.parse_obj(
+ {"username": obj.get("username"), "email": obj.get("email"), "is_superuser": obj.get("is_superuser")}
+ )
+ return _obj
diff --git a/docs/static/.nojekyll b/generated/groundlight_openapi_client/py.typed
similarity index 100%
rename from docs/static/.nojekyll
rename to generated/groundlight_openapi_client/py.typed
diff --git a/generated/groundlight_openapi_client/rest.py b/generated/groundlight_openapi_client/rest.py
index 16d8ca86..ca01d1d9 100644
--- a/generated/groundlight_openapi_client/rest.py
+++ b/generated/groundlight_openapi_client/rest.py
@@ -1,23 +1,26 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
import io
import json
import logging
import re
import ssl
-from urllib.parse import urlencode
-from urllib.parse import urlparse
-from urllib.request import proxy_bypass_environment
+
+from urllib.parse import urlencode, quote_plus
import urllib3
-import ipaddress
from groundlight_openapi_client.exceptions import (
ApiException,
@@ -26,14 +29,27 @@
NotFoundException,
ServiceException,
ApiValueError,
+ BadRequestException,
)
logger = logging.getLogger(__name__)
+SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
+
+
+def is_socks_proxy_url(url):
+ if url is None:
+ return False
+ split_section = url.split("://")
+ if len(split_section) < 2:
+ return False
+ else:
+ return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
+
class RESTResponse(io.IOBase):
- def __init__(self, resp):
+ def __init__(self, resp) -> None:
self.urllib3_response = resp
self.status = resp.status
self.reason = resp.reason
@@ -41,15 +57,15 @@ def __init__(self, resp):
def getheaders(self):
"""Returns a dictionary of the response headers."""
- return self.urllib3_response.getheaders()
+ return self.urllib3_response.headers
def getheader(self, name, default=None):
"""Returns a given response header."""
- return self.urllib3_response.getheader(name, default)
+ return self.urllib3_response.headers.get(name, default)
-class RESTClientObject(object):
- def __init__(self, configuration, pools_size=4, maxsize=None):
+class RESTClientObject:
+ def __init__(self, configuration, pools_size=4, maxsize=None) -> None:
# 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
@@ -69,6 +85,9 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
if configuration.retries is not None:
addition_pool_args["retries"] = configuration.retries
+ if configuration.tls_server_name:
+ addition_pool_args["server_hostname"] = configuration.tls_server_name
+
if configuration.socket_options is not None:
addition_pool_args["socket_options"] = configuration.socket_options
@@ -79,18 +98,31 @@ def __init__(self, configuration, pools_size=4, maxsize=None):
maxsize = 4
# https pool manager
- if configuration.proxy and not should_bypass_proxies(configuration.host, no_proxy=configuration.no_proxy or ""):
- self.pool_manager = urllib3.ProxyManager(
- num_pools=pools_size,
- maxsize=maxsize,
- cert_reqs=cert_reqs,
- ca_certs=configuration.ssl_ca_cert,
- cert_file=configuration.cert_file,
- key_file=configuration.key_file,
- proxy_url=configuration.proxy,
- proxy_headers=configuration.proxy_headers,
- **addition_pool_args,
- )
+ if configuration.proxy:
+ if is_socks_proxy_url(configuration.proxy):
+ from urllib3.contrib.socks import SOCKSProxyManager
+
+ self.pool_manager = SOCKSProxyManager(
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ proxy_url=configuration.proxy,
+ headers=configuration.proxy_headers,
+ **addition_pool_args,
+ )
+ else:
+ self.pool_manager = urllib3.ProxyManager(
+ num_pools=pools_size,
+ maxsize=maxsize,
+ cert_reqs=cert_reqs,
+ ca_certs=configuration.ssl_ca_cert,
+ cert_file=configuration.cert_file,
+ key_file=configuration.key_file,
+ proxy_url=configuration.proxy,
+ proxy_headers=configuration.proxy_headers,
+ **addition_pool_args,
+ )
else:
self.pool_manager = urllib3.PoolManager(
num_pools=pools_size,
@@ -139,6 +171,9 @@ def request(
post_params = post_params or {}
headers = headers or {}
+ # url already contains the URL query string
+ # so reset query_params to empty dict
+ query_params = {}
timeout = None
if _request_timeout:
@@ -150,12 +185,9 @@ def request(
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]:
- # Only set a default Content-Type for POST, PUT, PATCH and OPTIONS requests
- if (method != "DELETE") and ("Content-Type" not in headers):
- headers["Content-Type"] = "application/json"
- if query_params:
- url += "?" + urlencode(query_params)
- if ("Content-Type" not in headers) or (re.search("json", headers["Content-Type"], re.IGNORECASE)):
+
+ # no content type provided or payload is json
+ if not headers.get("Content-Type") or re.search("json", headers["Content-Type"], re.IGNORECASE):
request_body = None
if body is not None:
request_body = json.dumps(body)
@@ -182,6 +214,8 @@ def request(
# Content-Type which generated by urllib3 will be
# overwritten.
del headers["Content-Type"]
+ # Ensures that dict objects are serialized
+ post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a, b) for a, b in post_params]
r = self.pool_manager.request(
method,
url,
@@ -213,7 +247,7 @@ def request(
# For `GET`, `HEAD`
else:
r = self.pool_manager.request(
- method, url, fields=query_params, preload_content=_preload_content, timeout=timeout, headers=headers
+ method, url, fields={}, preload_content=_preload_content, timeout=timeout, headers=headers
)
except urllib3.exceptions.SSLError as e:
msg = "{0}\n{1}".format(type(e).__name__, str(e))
@@ -226,6 +260,9 @@ def request(
logger.debug("response body: %s", r.data)
if not 200 <= r.status <= 299:
+ if r.status == 400:
+ raise BadRequestException(http_resp=r)
+
if r.status == 401:
raise UnauthorizedException(http_resp=r)
@@ -242,7 +279,7 @@ def request(
return r
- def GET(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
+ def get_request(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
return self.request(
"GET",
url,
@@ -252,7 +289,7 @@ def GET(self, url, headers=None, query_params=None, _preload_content=True, _requ
query_params=query_params,
)
- def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
+ def head_request(self, url, headers=None, query_params=None, _preload_content=True, _request_timeout=None):
return self.request(
"HEAD",
url,
@@ -262,7 +299,7 @@ def HEAD(self, url, headers=None, query_params=None, _preload_content=True, _req
query_params=query_params,
)
- def OPTIONS(
+ def options_request(
self,
url,
headers=None,
@@ -283,7 +320,9 @@ def OPTIONS(
body=body,
)
- def DELETE(self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None):
+ def delete_request(
+ self, url, headers=None, query_params=None, body=None, _preload_content=True, _request_timeout=None
+ ):
return self.request(
"DELETE",
url,
@@ -294,7 +333,7 @@ def DELETE(self, url, headers=None, query_params=None, body=None, _preload_conte
body=body,
)
- def POST(
+ def post_request(
self,
url,
headers=None,
@@ -315,7 +354,7 @@ def POST(
body=body,
)
- def PUT(
+ def put_request(
self,
url,
headers=None,
@@ -336,7 +375,7 @@ def PUT(
body=body,
)
- def PATCH(
+ def patch_request(
self,
url,
headers=None,
@@ -356,54 +395,3 @@ def PATCH(
_request_timeout=_request_timeout,
body=body,
)
-
-
-# end of class RESTClientObject
-def is_ipv4(target):
- """Test if IPv4 address or not"""
- try:
- chk = ipaddress.IPv4Address(target)
- return True
- except ipaddress.AddressValueError:
- return False
-
-
-def in_ipv4net(target, net):
- """Test if target belongs to given IPv4 network"""
- try:
- nw = ipaddress.IPv4Network(net)
- ip = ipaddress.IPv4Address(target)
- if ip in nw:
- return True
- return False
- except ipaddress.AddressValueError:
- return False
- except ipaddress.NetmaskValueError:
- return False
-
-
-def should_bypass_proxies(url, no_proxy=None):
- """Yet another requests.should_bypass_proxies
- Test if proxies should not be used for a particular url.
- """
-
- parsed = urlparse(url)
-
- # special cases
- if parsed.hostname in [None, ""]:
- return True
-
- # special cases
- if no_proxy in [None, ""]:
- return False
- if no_proxy == "*":
- return True
-
- no_proxy = no_proxy.lower().replace(" ", "")
- entries = (host for host in no_proxy.split(",") if host)
-
- if is_ipv4(parsed.hostname):
- for item in entries:
- if in_ipv4net(parsed.hostname, item):
- return True
- return proxy_bypass_environment(parsed.hostname, {"no": no_proxy})
diff --git a/generated/model.py b/generated/model.py
deleted file mode 100644
index dc6348b8..00000000
--- a/generated/model.py
+++ /dev/null
@@ -1,528 +0,0 @@
-# generated by datamodel-codegen:
-# filename: public-api.yaml
-# timestamp: 2025-05-06T17:51:03+00:00
-
-from __future__ import annotations
-
-from datetime import datetime
-from enum import Enum
-from typing import Any, Dict, List, Optional, Union
-
-from pydantic import AnyUrl, BaseModel, Field, RootModel, confloat, conint, constr
-
-
-class BBoxGeometry(BaseModel):
- """
- Mixin for serializers to handle data in the StrictBaseModel format
- """
-
- left: float
- top: float
- right: float
- bottom: float
- x: float
- y: float
-
-
-class BBoxGeometryRequest(BaseModel):
- """
- Mixin for serializers to handle data in the StrictBaseModel format
- """
-
- left: float
- top: float
- right: float
- bottom: float
-
-
-class BlankEnum(Enum):
- field_ = ""
-
-
-class Condition(BaseModel):
- verb: str
- parameters: Dict[str, Any]
-
-
-class ConditionRequest(BaseModel):
- verb: str
- parameters: Dict[str, Any]
-
-
-class DetectorGroup(BaseModel):
- id: str
- name: constr(max_length=100)
-
-
-class DetectorGroupRequest(BaseModel):
- name: constr(min_length=1, max_length=100)
-
-
-class DetectorTypeEnum(str, Enum):
- detector = "detector"
-
-
-class EdgeModelInfo(BaseModel):
- """
- Information for the model running on edge, including temporary presigned urls to the model binaries
- """
-
- model_binary_id: Optional[str] = None
- model_binary_url: Optional[str] = None
- oodd_model_binary_id: Optional[str] = None
- oodd_model_binary_url: Optional[str] = None
- pipeline_config: Optional[Any] = None
- oodd_pipeline_config: Optional[Any] = None
- predictor_metadata: Optional[Any] = None
-
-
-class ImageQueryTypeEnum(str, Enum):
- image_query = "image_query"
-
-
-class ModeEnum(str, Enum):
- BINARY = "BINARY"
- COUNT = "COUNT"
- MULTI_CLASS = "MULTI_CLASS"
- TEXT = "TEXT"
- BOUNDING_BOX = "BOUNDING_BOX"
-
-
-class Note(BaseModel):
- detector_id: str
- content: Optional[str] = Field(None, description="Text content of the note.")
- is_pinned: Optional[bool] = None
-
-
-class NoteRequest(BaseModel):
- content: Optional[str] = Field(None, description="Text content of the note.")
- is_pinned: Optional[bool] = None
- image: Optional[bytes] = None
-
-
-class PayloadTemplate(BaseModel):
- template: str
- headers: Optional[Dict[str, str]] = None
-
-
-class PayloadTemplateRequest(BaseModel):
- template: constr(min_length=1)
- headers: Optional[Dict[str, constr(min_length=1)]] = None
-
-
-class ROI(BaseModel):
- """
- Mixin for serializers to handle data in the StrictBaseModel format
- """
-
- label: str = Field(..., description="The label of the bounding box.")
- score: float = Field(..., description="The confidence of the bounding box.")
- geometry: BBoxGeometry
-
-
-class ROIRequest(BaseModel):
- """
- Mixin for serializers to handle data in the StrictBaseModel format
- """
-
- label: constr(min_length=1) = Field(..., description="The label of the bounding box.")
- geometry: BBoxGeometryRequest
-
-
-class ResultTypeEnum(str, Enum):
- binary_classification = "binary_classification"
- counting = "counting"
- multi_classification = "multi_classification"
- text_recognition = "text_recognition"
- bounding_box = "bounding_box"
-
-
-class SnoozeTimeUnitEnum(str, Enum):
- """
- * `DAYS` - DAYS
- * `HOURS` - HOURS
- * `MINUTES` - MINUTES
- * `SECONDS` - SECONDS
- """
-
- DAYS = "DAYS"
- HOURS = "HOURS"
- MINUTES = "MINUTES"
- SECONDS = "SECONDS"
-
-
-class StatusEnum(str, Enum):
- """
- * `ON` - ON
- * `OFF` - OFF
- """
-
- ON = "ON"
- OFF = "OFF"
-
-
-class WebhookAction(BaseModel):
- url: AnyUrl
- include_image: Optional[bool] = None
- payload_template: Optional[PayloadTemplate] = None
- last_message_failed: Optional[bool] = None
- last_failure_error: Optional[str] = None
- last_failed_at: Optional[datetime] = None
-
-
-class WebhookActionRequest(BaseModel):
- url: AnyUrl
- include_image: Optional[bool] = None
- payload_template: Optional[PayloadTemplateRequest] = None
- last_message_failed: Optional[bool] = None
- last_failure_error: Optional[str] = None
- last_failed_at: Optional[datetime] = None
-
-
-class ResultType(Enum):
- binary_classification = "binary_classification"
-
-
-class BinaryClassificationResult(BaseModel):
- confidence: Optional[confloat(ge=0.0, le=1.0)] = None
- source: Optional[str] = None
- result_type: Optional[ResultType] = None
- from_edge: Optional[bool] = None
- label: str
-
-
-class ResultType2(Enum):
- counting = "counting"
-
-
-class CountingResult(BaseModel):
- confidence: Optional[confloat(ge=0.0, le=1.0)] = None
- source: Optional[str] = None
- result_type: Optional[ResultType2] = None
- from_edge: Optional[bool] = None
- count: Optional[conint(ge=0)] = Field(...)
- greater_than_max: Optional[bool] = None
-
-
-class ResultType3(Enum):
- multi_classification = "multi_classification"
-
-
-class MultiClassificationResult(BaseModel):
- confidence: Optional[confloat(ge=0.0, le=1.0)] = None
- source: Optional[str] = None
- result_type: Optional[ResultType3] = None
- from_edge: Optional[bool] = None
- label: str
-
-
-class ResultType4(Enum):
- text_recognition = "text_recognition"
-
-
-class TextRecognitionResult(BaseModel):
- confidence: Optional[confloat(ge=0.0, le=1.0)] = None
- source: Optional[str] = None
- result_type: Optional[ResultType4] = None
- from_edge: Optional[bool] = None
- text: Optional[str] = Field(...)
- truncated: bool
-
-
-class ResultType5(Enum):
- bounding_box = "bounding_box"
-
-
-class BoundingBoxResult(BaseModel):
- confidence: Optional[confloat(ge=0.0, le=1.0)] = None
- source: Optional[str] = None
- result_type: Optional[ResultType5] = None
- from_edge: Optional[bool] = None
- label: str
-
-
-class CountModeConfiguration(BaseModel):
- max_count: Optional[conint(ge=1, le=50)] = None
- class_name: str
-
-
-class MultiClassModeConfiguration(BaseModel):
- class_names: List[str]
- num_classes: Optional[int] = None
-
-
-class TextModeConfiguration(BaseModel):
- value_max_length: Optional[conint(ge=1, le=250)] = None
-
-
-class BoundingBoxModeConfiguration(BaseModel):
- class_name: str
- max_num_bboxes: Optional[conint(ge=1, le=50)] = None
-
-
-class ChannelEnum(str, Enum):
- TEXT = "TEXT"
- EMAIL = "EMAIL"
-
-
-class Action(BaseModel):
- channel: ChannelEnum
- recipient: str
- include_image: bool
-
-
-class ActionList(RootModel[List[Action]]):
- root: List[Action]
-
-
-class AnnotationsRequestedEnum(str, Enum):
- BINARY_CLASSIFICATION = "BINARY_CLASSIFICATION"
- BOUNDING_BOXES = "BOUNDING_BOXES"
-
-
-class EscalationTypeEnum(str, Enum):
- STANDARD = "STANDARD"
- NO_HUMAN_LABELING = "NO_HUMAN_LABELING"
-
-
-class SourceEnum(str, Enum):
- INITIAL_PLACEHOLDER = "INITIAL_PLACEHOLDER"
- CLOUD = "CLOUD"
- CUST = "CUST"
- HUMAN_CLOUD_ENSEMBLE = "HUMAN_CLOUD_ENSEMBLE"
- ALG = "ALG"
- ALG_REC = "ALG_REC"
- ALG_UNCLEAR = "ALG_UNCLEAR"
- EDGE = "EDGE"
-
-
-class VerbEnum(str, Enum):
- ANSWERED_CONSECUTIVELY = "ANSWERED_CONSECUTIVELY"
- ANSWERED_WITHIN_TIME = "ANSWERED_WITHIN_TIME"
- CHANGED_TO = "CHANGED_TO"
- NO_CHANGE = "NO_CHANGE"
- NO_QUERIES = "NO_QUERIES"
-
-
-class Source(str, Enum):
- STILL_PROCESSING = "STILL_PROCESSING"
- CLOUD = "CLOUD"
- USER = "USER"
- CLOUD_ENSEMBLE = "CLOUD_ENSEMBLE"
- ALGORITHM = "ALGORITHM"
- EDGE = "EDGE"
-
-
-class Label(str, Enum):
- YES = "YES"
- NO = "NO"
- UNCLEAR = "UNCLEAR"
-
-
-class AllNotes(BaseModel):
- """
- Serializes all notes for a given detector, grouped by type as listed in UserProfile.NoteCategoryChoices
- The fields must match whats in USERPROFILE.NoteCategoryChoices
- """
-
- CUSTOMER: List[Note]
- GL: List[Note]
-
-
-class Detector(BaseModel):
- """
- Groundlight Detectors provide answers to natural language questions about images.
-
- Each detector can answer a single question, and multiple detectors can be strung together for
- more complex logic. Detectors can be created through the create_detector method, or through the
- create_[MODE]_detector methods for pro tier users
- """
-
- id: str = Field(..., description="A unique ID for this object.")
- type: DetectorTypeEnum = Field(..., description="The type of this object.")
- created_at: datetime = Field(..., description="When this detector was created.")
- name: constr(max_length=200) = Field(..., description="A short, descriptive name for the detector.")
- query: str = Field(..., description="A question about the image.")
- group_name: str = Field(..., description="Which group should this detector be part of?")
- confidence_threshold: confloat(ge=0.0, le=1.0) = Field(
- 0.9,
- description=(
- "If the detector's prediction is below this confidence threshold, send the image query for human review."
- ),
- )
- patience_time: confloat(ge=0.0, le=3600.0) = Field(
- 30.0, description="How long Groundlight will attempt to generate a confident prediction"
- )
- metadata: Optional[Dict[str, Any]] = Field(..., description="Metadata about the detector.")
- mode: str
- mode_configuration: Optional[Dict[str, Any]] = Field(...)
- status: Optional[Union[StatusEnum, BlankEnum]] = None
- escalation_type: Optional[str] = None
-
-
-class DetectorCreationInputRequest(BaseModel):
- """
- Helper serializer for validating POST /detectors input.
- """
-
- name: constr(min_length=1, max_length=200) = Field(..., description="A short, descriptive name for the detector.")
- query: constr(min_length=1, max_length=300) = Field(..., description="A question about the image.")
- group_name: Optional[constr(min_length=1, max_length=100)] = Field(
- None, description="Which group should this detector be part of?"
- )
- confidence_threshold: confloat(ge=0.0, le=1.0) = Field(
- 0.9,
- description=(
- "If the detector's prediction is below this confidence threshold, send the image query for human review."
- ),
- )
- patience_time: confloat(ge=0.0, le=3600.0) = Field(
- 30.0, description="How long Groundlight will attempt to generate a confident prediction"
- )
- pipeline_config: Optional[constr(max_length=100)] = Field(
- None, description="(Advanced usage) Configuration needed to instantiate a prediction pipeline."
- )
- metadata: Optional[constr(min_length=1, max_length=1362)] = Field(
- None,
- description=(
- "Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after"
- " encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding."
- ),
- )
- mode: ModeEnum = Field(
- "BINARY",
- description=(
- "Mode in which this detector will work.\n\n* `BINARY` - BINARY\n* `COUNT` - COUNT\n* `MULTI_CLASS` -"
- " MULTI_CLASS\n* `TEXT` - TEXT\n* `BOUNDING_BOX` - BOUNDING_BOX"
- ),
- )
- mode_configuration: Optional[
- Union[CountModeConfiguration, MultiClassModeConfiguration, TextModeConfiguration, BoundingBoxModeConfiguration]
- ] = None
-
-
-class ImageQuery(BaseModel):
- """
- ImageQuery objects are the answers to natural language questions about images created by detectors.
- """
-
- metadata: Optional[Dict[str, Any]] = Field(..., description="Metadata about the image query.")
- id: str = Field(..., description="A unique ID for this object.")
- type: ImageQueryTypeEnum = Field(..., description="The type of this object.")
- created_at: datetime = Field(..., description="When was this detector created?")
- query: str = Field(..., description="A question about the image.")
- detector_id: str = Field(..., description="Which detector was used on this image query?")
- result_type: ResultTypeEnum = Field(..., description="What type of result are we returning?")
- result: Optional[
- Union[
- BinaryClassificationResult,
- CountingResult,
- MultiClassificationResult,
- TextRecognitionResult,
- BoundingBoxResult,
- ]
- ] = Field(...)
- patience_time: float = Field(..., description="How long to wait for a confident response.")
- confidence_threshold: float = Field(
- ..., description="Min confidence needed to accept the response of the image query."
- )
- rois: Optional[List[ROI]] = Field(
- ..., description="An array of regions of interest (bounding boxes) collected on image"
- )
- text: Optional[str] = Field(..., description="A text field on image query.")
- done_processing: bool = Field(
- False,
- description="EDGE ONLY - Whether the image query has completed escalating and will receive no new results.",
- )
-
-
-class LabelValue(BaseModel):
- confidence: Optional[float] = Field(...)
- class_name: Optional[str] = Field(
- ..., description="Return a human-readable class name for this label (e.g. YES/NO)"
- )
- rois: Optional[List[ROI]] = None
- annotations_requested: List[str]
- created_at: datetime
- detector_id: Optional[int] = Field(...)
- source: str
- text: Optional[str] = Field(..., description="Text annotations")
-
-
-class LabelValueRequest(BaseModel):
- label: Optional[str] = Field(...)
- image_query_id: constr(min_length=1)
- rois: Optional[List[ROIRequest]] = None
-
-
-class PaginatedDetectorList(BaseModel):
- count: int = Field(..., example=123)
- next: Optional[AnyUrl] = Field(None, example="http://api.example.org/accounts/?page=4")
- previous: Optional[AnyUrl] = Field(None, example="http://api.example.org/accounts/?page=2")
- results: List[Detector]
-
-
-class PaginatedImageQueryList(BaseModel):
- count: int = Field(..., example=123)
- next: Optional[AnyUrl] = Field(None, example="http://api.example.org/accounts/?page=4")
- previous: Optional[AnyUrl] = Field(None, example="http://api.example.org/accounts/?page=2")
- results: List[ImageQuery]
-
-
-class PatchedDetectorRequest(BaseModel):
- """
- Groundlight Detectors provide answers to natural language questions about images.
-
- Each detector can answer a single question, and multiple detectors can be strung together for
- more complex logic. Detectors can be created through the create_detector method, or through the
- create_[MODE]_detector methods for pro tier users
- """
-
- name: Optional[constr(min_length=1, max_length=200)] = Field(
- None, description="A short, descriptive name for the detector."
- )
- confidence_threshold: confloat(ge=0.0, le=1.0) = Field(
- 0.9,
- description=(
- "If the detector's prediction is below this confidence threshold, send the image query for human review."
- ),
- )
- patience_time: confloat(ge=0.0, le=3600.0) = Field(
- 30.0, description="How long Groundlight will attempt to generate a confident prediction"
- )
- status: Optional[Union[StatusEnum, BlankEnum]] = None
- escalation_type: Optional[constr(min_length=1)] = None
-
-
-class Rule(BaseModel):
- id: int
- detector_id: str
- detector_name: str
- name: constr(max_length=44)
- enabled: bool = True
- snooze_time_enabled: bool = False
- snooze_time_value: conint(ge=0) = 0
- snooze_time_unit: SnoozeTimeUnitEnum = "DAYS"
- human_review_required: bool = False
- condition: Condition
- action: Optional[Union[Action, ActionList]] = None
- webhook_action: Optional[List[WebhookAction]] = None
-
-
-class RuleRequest(BaseModel):
- name: constr(min_length=1, max_length=44)
- enabled: bool = True
- snooze_time_enabled: bool = False
- snooze_time_value: conint(ge=0) = 0
- snooze_time_unit: SnoozeTimeUnitEnum = "DAYS"
- human_review_required: bool = False
- condition: ConditionRequest
- action: Optional[Union[Action, ActionList]] = None
- webhook_action: Optional[List[WebhookActionRequest]] = None
-
-
-class PaginatedRuleList(BaseModel):
- count: int = Field(..., example=123)
- next: Optional[AnyUrl] = Field(None, example="http://api.example.org/accounts/?page=4")
- previous: Optional[AnyUrl] = Field(None, example="http://api.example.org/accounts/?page=2")
- results: List[Rule]
diff --git a/generated/pyproject.toml b/generated/pyproject.toml
new file mode 100644
index 00000000..2f913d9b
--- /dev/null
+++ b/generated/pyproject.toml
@@ -0,0 +1,30 @@
+[tool.poetry]
+name = "groundlight_openapi_client"
+version = "1.0.0"
+description = "Groundlight API"
+authors = ["support@groundlight.ai "]
+license = "NoLicense"
+readme = "README.md"
+repository = "https://github.com/GIT_USER_ID/GIT_REPO_ID"
+keywords = ["OpenAPI", "OpenAPI-Generator", "Groundlight API"]
+include = ["groundlight_openapi_client/py.typed"]
+
+[tool.poetry.dependencies]
+python = "^3.8"
+
+urllib3 = ">= 1.25.3"
+python-dateutil = ">=2.8.2"
+pydantic = "^1.10.5, <2"
+aenum = ">=3.1.11"
+
+[tool.poetry.dev-dependencies]
+pytest = ">=7.2.1"
+tox = ">=3.9.0"
+flake8 = ">=4.0.0"
+
+[build-system]
+requires = ["setuptools"]
+build-backend = "setuptools.build_meta"
+
+[tool.pylint.'MESSAGES CONTROL']
+extension-pkg-whitelist = "pydantic"
diff --git a/generated/requirements.txt b/generated/requirements.txt
index 96947f60..0a8bf96c 100644
--- a/generated/requirements.txt
+++ b/generated/requirements.txt
@@ -1,3 +1,5 @@
python_dateutil >= 2.5.3
setuptools >= 21.0.0
-urllib3 >= 1.25.3
+urllib3 >= 1.25.3, < 3.0.0
+pydantic >= 1.10.5, < 2
+aenum >= 3.1.11
diff --git a/generated/setup.py b/generated/setup.py
index 9c4bb572..8167d5b8 100644
--- a/generated/setup.py
+++ b/generated/setup.py
@@ -1,28 +1,30 @@
+# coding: utf-8
+
"""
Groundlight API
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
The version of the OpenAPI document: 0.18.2
Contact: support@groundlight.ai
- Generated by: https://openapi-generator.tech
-"""
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
from setuptools import setup, find_packages # noqa: H301
-NAME = "groundlight-openapi-client"
-VERSION = "1.0.0"
# To install the library, run the following
#
# python setup.py install
#
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
-
-REQUIRES = [
- "urllib3 >= 1.25.3",
- "python-dateutil",
-]
+NAME = "groundlight-openapi-client"
+VERSION = "1.0.0"
+PYTHON_REQUIRES = ">=3.7"
+REQUIRES = ["urllib3 >= 1.25.3, < 3.0.0", "python-dateutil", "pydantic >= 1.10.5, < 2", "aenum"]
setup(
name=NAME,
@@ -32,11 +34,12 @@
author_email="support@groundlight.ai",
url="",
keywords=["OpenAPI", "OpenAPI-Generator", "Groundlight API"],
- python_requires=">=3.6",
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
include_package_data=True,
+ long_description_content_type="text/markdown",
long_description="""\
- Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language. # noqa: E501
- """,
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+ """, # noqa: E501
+ package_data={"groundlight_openapi_client": ["py.typed"]},
)
diff --git a/generated/test-requirements.txt b/generated/test-requirements.txt
index bb4f22bb..3a0d0b93 100644
--- a/generated/test-requirements.txt
+++ b/generated/test-requirements.txt
@@ -1 +1,3 @@
+pytest~=7.1.3
pytest-cov>=2.8.1
+pytest-randomly>=3.12.0
diff --git a/generated/test/test_detector_creation_input_request_mode_configuration.py b/generated/test/test_detector_creation_input_request_mode_configuration.py
new file mode 100644
index 00000000..e666db4c
--- /dev/null
+++ b/generated/test/test_detector_creation_input_request_mode_configuration.py
@@ -0,0 +1,67 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.detector_creation_input_request_mode_configuration import (
+ DetectorCreationInputRequestModeConfiguration,
+)
+
+
+class TestDetectorCreationInputRequestModeConfiguration(unittest.TestCase):
+ """DetectorCreationInputRequestModeConfiguration unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DetectorCreationInputRequestModeConfiguration:
+ """Test DetectorCreationInputRequestModeConfiguration
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `DetectorCreationInputRequestModeConfiguration`
+ """
+ model = DetectorCreationInputRequestModeConfiguration()
+ if include_optional:
+ return DetectorCreationInputRequestModeConfiguration(
+ max_count = 1,
+ class_name = '',
+ class_names = [
+ ''
+ ],
+ num_classes = 56,
+ value_max_length = 1,
+ max_num_bboxes = 1
+ )
+ else:
+ return DetectorCreationInputRequestModeConfiguration(
+ class_name = '',
+ class_names = [
+ ''
+ ],
+ )
+ """
+
+ def testDetectorCreationInputRequestModeConfiguration(self):
+ """Test DetectorCreationInputRequestModeConfiguration"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_detector_status.py b/generated/test/test_detector_status.py
new file mode 100644
index 00000000..2f79ee38
--- /dev/null
+++ b/generated/test/test_detector_status.py
@@ -0,0 +1,53 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.detector_status import DetectorStatus
+
+
+class TestDetectorStatus(unittest.TestCase):
+ """DetectorStatus unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> DetectorStatus:
+ """Test DetectorStatus
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `DetectorStatus`
+ """
+ model = DetectorStatus()
+ if include_optional:
+ return DetectorStatus(
+ )
+ else:
+ return DetectorStatus(
+ )
+ """
+
+ def testDetectorStatus(self):
+ """Test DetectorStatus"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_get_detector_evaluation200_response.py b/generated/test/test_get_detector_evaluation200_response.py
new file mode 100644
index 00000000..4f7345f8
--- /dev/null
+++ b/generated/test/test_get_detector_evaluation200_response.py
@@ -0,0 +1,73 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.get_detector_evaluation200_response import GetDetectorEvaluation200Response
+
+
+class TestGetDetectorEvaluation200Response(unittest.TestCase):
+ """GetDetectorEvaluation200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> GetDetectorEvaluation200Response:
+ """Test GetDetectorEvaluation200Response
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `GetDetectorEvaluation200Response`
+ """
+ model = GetDetectorEvaluation200Response()
+ if include_optional:
+ return GetDetectorEvaluation200Response(
+ evaluation_results = groundlight_openapi_client.models.get_detector_evaluation_200_response_evaluation_results.get_detector_evaluation_200_response_evaluation_results(
+ eval_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ total_ground_truth_examples = 56,
+ total_labeled_examples = 56,
+ kfold_pooled__balanced_accuracy = 1.337,
+ kfold_pooled__positive_accuracy = 1.337,
+ kfold_pooled__negative_accuracy = 1.337,
+ precision__mean = 1.337,
+ recall__mean = 1.337,
+ roc_auc__mean = 1.337,
+ balanced_system_accuracies = { },
+ positive_system_accuracies = { },
+ negative_system_accuracies = { },
+ mean_absolute_error__mean = 1.337,
+ objdet_precision__mean = 1.337,
+ objdet_recall__mean = 1.337,
+ objdet_f1_score__mean = 1.337,
+ class_accuracies = { },
+ confusion_dict = { },
+ num_examples_per_class = { }, )
+ )
+ else:
+ return GetDetectorEvaluation200Response(
+ )
+ """
+
+ def testGetDetectorEvaluation200Response(self):
+ """Test GetDetectorEvaluation200Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_get_detector_evaluation200_response_evaluation_results.py b/generated/test/test_get_detector_evaluation200_response_evaluation_results.py
new file mode 100644
index 00000000..c5d5a52e
--- /dev/null
+++ b/generated/test/test_get_detector_evaluation200_response_evaluation_results.py
@@ -0,0 +1,74 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.get_detector_evaluation200_response_evaluation_results import (
+ GetDetectorEvaluation200ResponseEvaluationResults,
+)
+
+
+class TestGetDetectorEvaluation200ResponseEvaluationResults(unittest.TestCase):
+ """GetDetectorEvaluation200ResponseEvaluationResults unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> GetDetectorEvaluation200ResponseEvaluationResults:
+ """Test GetDetectorEvaluation200ResponseEvaluationResults
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `GetDetectorEvaluation200ResponseEvaluationResults`
+ """
+ model = GetDetectorEvaluation200ResponseEvaluationResults()
+ if include_optional:
+ return GetDetectorEvaluation200ResponseEvaluationResults(
+ eval_timestamp = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
+ total_ground_truth_examples = 56,
+ total_labeled_examples = 56,
+ kfold_pooled__balanced_accuracy = 1.337,
+ kfold_pooled__positive_accuracy = 1.337,
+ kfold_pooled__negative_accuracy = 1.337,
+ precision__mean = 1.337,
+ recall__mean = 1.337,
+ roc_auc__mean = 1.337,
+ balanced_system_accuracies = { },
+ positive_system_accuracies = { },
+ negative_system_accuracies = { },
+ mean_absolute_error__mean = 1.337,
+ objdet_precision__mean = 1.337,
+ objdet_recall__mean = 1.337,
+ objdet_f1_score__mean = 1.337,
+ class_accuracies = { },
+ confusion_dict = { },
+ num_examples_per_class = { }
+ )
+ else:
+ return GetDetectorEvaluation200ResponseEvaluationResults(
+ )
+ """
+
+ def testGetDetectorEvaluation200ResponseEvaluationResults(self):
+ """Test GetDetectorEvaluation200ResponseEvaluationResults"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_get_detector_metrics200_response.py b/generated/test/test_get_detector_metrics200_response.py
new file mode 100644
index 00000000..e02e93e3
--- /dev/null
+++ b/generated/test/test_get_detector_metrics200_response.py
@@ -0,0 +1,64 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.get_detector_metrics200_response import GetDetectorMetrics200Response
+
+
+class TestGetDetectorMetrics200Response(unittest.TestCase):
+ """GetDetectorMetrics200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> GetDetectorMetrics200Response:
+ """Test GetDetectorMetrics200Response
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `GetDetectorMetrics200Response`
+ """
+ model = GetDetectorMetrics200Response()
+ if include_optional:
+ return GetDetectorMetrics200Response(
+ summary = groundlight_openapi_client.models.get_detector_metrics_200_response_summary.get_detector_metrics_200_response_summary(
+ num_ground_truth = 56,
+ num_current_source_human = 56,
+ class_counts = groundlight_openapi_client.models.get_detector_metrics_200_response_summary_class_counts.get_detector_metrics_200_response_summary_class_counts(
+ source_ml = groundlight_openapi_client.models.source_ml.source_ml(),
+ source_human = groundlight_openapi_client.models.source_human.source_human(),
+ cloud_labeler = groundlight_openapi_client.models.cloud_labeler.cloud_labeler(),
+ cloud = groundlight_openapi_client.models.cloud.cloud(),
+ total = groundlight_openapi_client.models.total.total(), ),
+ unconfident_counts = groundlight_openapi_client.models.unconfident_counts.unconfident_counts(),
+ total_iqs = 56, )
+ )
+ else:
+ return GetDetectorMetrics200Response(
+ )
+ """
+
+ def testGetDetectorMetrics200Response(self):
+ """Test GetDetectorMetrics200Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_get_detector_metrics200_response_summary.py b/generated/test/test_get_detector_metrics200_response_summary.py
new file mode 100644
index 00000000..683ac405
--- /dev/null
+++ b/generated/test/test_get_detector_metrics200_response_summary.py
@@ -0,0 +1,65 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary import (
+ GetDetectorMetrics200ResponseSummary,
+)
+
+
+class TestGetDetectorMetrics200ResponseSummary(unittest.TestCase):
+ """GetDetectorMetrics200ResponseSummary unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> GetDetectorMetrics200ResponseSummary:
+ """Test GetDetectorMetrics200ResponseSummary
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `GetDetectorMetrics200ResponseSummary`
+ """
+ model = GetDetectorMetrics200ResponseSummary()
+ if include_optional:
+ return GetDetectorMetrics200ResponseSummary(
+ num_ground_truth = 56,
+ num_current_source_human = 56,
+ class_counts = groundlight_openapi_client.models.get_detector_metrics_200_response_summary_class_counts.get_detector_metrics_200_response_summary_class_counts(
+ source_ml = groundlight_openapi_client.models.source_ml.source_ml(),
+ source_human = groundlight_openapi_client.models.source_human.source_human(),
+ cloud_labeler = groundlight_openapi_client.models.cloud_labeler.cloud_labeler(),
+ cloud = groundlight_openapi_client.models.cloud.cloud(),
+ total = groundlight_openapi_client.models.total.total(), ),
+ unconfident_counts = None,
+ total_iqs = 56
+ )
+ else:
+ return GetDetectorMetrics200ResponseSummary(
+ )
+ """
+
+ def testGetDetectorMetrics200ResponseSummary(self):
+ """Test GetDetectorMetrics200ResponseSummary"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_get_detector_metrics200_response_summary_class_counts.py b/generated/test/test_get_detector_metrics200_response_summary_class_counts.py
new file mode 100644
index 00000000..96f27976
--- /dev/null
+++ b/generated/test/test_get_detector_metrics200_response_summary_class_counts.py
@@ -0,0 +1,60 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.get_detector_metrics200_response_summary_class_counts import (
+ GetDetectorMetrics200ResponseSummaryClassCounts,
+)
+
+
+class TestGetDetectorMetrics200ResponseSummaryClassCounts(unittest.TestCase):
+ """GetDetectorMetrics200ResponseSummaryClassCounts unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> GetDetectorMetrics200ResponseSummaryClassCounts:
+ """Test GetDetectorMetrics200ResponseSummaryClassCounts
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `GetDetectorMetrics200ResponseSummaryClassCounts`
+ """
+ model = GetDetectorMetrics200ResponseSummaryClassCounts()
+ if include_optional:
+ return GetDetectorMetrics200ResponseSummaryClassCounts(
+ source_ml = None,
+ source_human = None,
+ cloud_labeler = None,
+ cloud = None,
+ total = None
+ )
+ else:
+ return GetDetectorMetrics200ResponseSummaryClassCounts(
+ )
+ """
+
+ def testGetDetectorMetrics200ResponseSummaryClassCounts(self):
+ """Test GetDetectorMetrics200ResponseSummaryClassCounts"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_image_query_result.py b/generated/test/test_image_query_result.py
new file mode 100644
index 00000000..bded808f
--- /dev/null
+++ b/generated/test/test_image_query_result.py
@@ -0,0 +1,66 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.image_query_result import ImageQueryResult
+
+
+class TestImageQueryResult(unittest.TestCase):
+ """ImageQueryResult unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> ImageQueryResult:
+ """Test ImageQueryResult
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `ImageQueryResult`
+ """
+ model = ImageQueryResult()
+ if include_optional:
+ return ImageQueryResult(
+ confidence = 0.0,
+ source = '',
+ result_type = 'bounding_box',
+ from_edge = True,
+ label = '',
+ count = 0,
+ greater_than_max = True,
+ text = '',
+ truncated = True
+ )
+ else:
+ return ImageQueryResult(
+ label = '',
+ count = 0,
+ text = '',
+ truncated = True,
+ )
+ """
+
+ def testImageQueryResult(self):
+ """Test ImageQueryResult"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_rule_action.py b/generated/test/test_rule_action.py
new file mode 100644
index 00000000..30484058
--- /dev/null
+++ b/generated/test/test_rule_action.py
@@ -0,0 +1,59 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.rule_action import RuleAction
+
+
+class TestRuleAction(unittest.TestCase):
+ """RuleAction unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> RuleAction:
+ """Test RuleAction
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `RuleAction`
+ """
+ model = RuleAction()
+ if include_optional:
+ return RuleAction(
+ channel = 'TEXT',
+ recipient = '',
+ include_image = True
+ )
+ else:
+ return RuleAction(
+ channel = 'TEXT',
+ recipient = '',
+ include_image = True,
+ )
+ """
+
+ def testRuleAction(self):
+ """Test RuleAction"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/generated/test/test_who_am_i200_response.py b/generated/test/test_who_am_i200_response.py
new file mode 100644
index 00000000..3ac7b6e7
--- /dev/null
+++ b/generated/test/test_who_am_i200_response.py
@@ -0,0 +1,54 @@
+# coding: utf-8
+
+"""
+ Groundlight API
+
+ Groundlight makes it simple to understand images. You can easily create computer vision detectors just by describing what you want to know using natural language.
+
+ The version of the OpenAPI document: 0.18.2
+ Contact: support@groundlight.ai
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
+
+ Do not edit the class manually.
+""" # noqa: E501
+
+
+import unittest
+
+from groundlight_openapi_client.models.who_am_i200_response import WhoAmI200Response
+
+
+class TestWhoAmI200Response(unittest.TestCase):
+ """WhoAmI200Response unit test stubs"""
+
+ def setUp(self):
+ pass
+
+ def tearDown(self):
+ pass
+
+ def make_instance(self, include_optional) -> WhoAmI200Response:
+ """Test WhoAmI200Response
+ include_optional is a boolean, when False only required
+ params are included, when True both required and
+ optional params are included"""
+ # uncomment below to create an instance of `WhoAmI200Response`
+ """
+ model = WhoAmI200Response()
+ if include_optional:
+ return WhoAmI200Response(
+ username = ''
+ )
+ else:
+ return WhoAmI200Response(
+ )
+ """
+
+ def testWhoAmI200Response(self):
+ """Test WhoAmI200Response"""
+ # inst_req_only = self.make_instance(include_optional=False)
+ # inst_req_and_optional = self.make_instance(include_optional=True)
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/openapitools.json b/openapitools.json
index 9cbc6d5d..959861ef 100644
--- a/openapitools.json
+++ b/openapitools.json
@@ -2,6 +2,6 @@
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
- "version": "5.4.0"
+ "version": "7.13.0"
}
-}
+}
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 59e52b94..64f18e6e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -16,12 +16,13 @@ version = "0.23.0"
certifi = ">=2023.7.22"
frozendict = "^2.3.2"
pillow = ">=11.0.0" # TODO: We may want to mark pillow (and numpy) as extra (https://python-poetry.org/docs/master/pyproject#extras)
-pydantic = "^2.0.0"
+pydantic = "<2.0"
python = ">=3.9,<4.0"
python-dateutil = "^2.9.0"
requests = "^2.28.2"
typer = "^0.15.4"
urllib3 = "^1.26.9"
+aenum = "^3.1.16"
[tool.poetry.group.dev.dependencies]
datamodel-code-generator = "^0.22.1"
@@ -40,17 +41,6 @@ ruff = "^0.4.4"
toml-sort = "^0.23.0"
types-requests = "^2.28.11.17"
-[tool.poetry.group.sphinx-deps.dependencies]
-# These are extra / stricter dependencies required to build the API reference docs
-Sphinx = {version = "^7.2.6", python = ">=3.9,<4.0"}
-autodoc-pydantic = {version = "^2.0.1", python = ">=3.9,<4.0"}
-pillow = "^11.0.0"
-pydantic = "^2.0.0"
-python = ">=3.9,<4.0"
-python-dateutil = "^2.8.2"
-sphinx-rtd-theme = {version = "^1.3.0", python = ">=3.9,<4.0"}
-toml = "^0.10.2"
-
[tool.poetry.scripts]
groundlight = "groundlight.cli:groundlight"
diff --git a/samples/README.md b/samples/README.md
deleted file mode 100644
index ba755704..00000000
--- a/samples/README.md
+++ /dev/null
@@ -1 +0,0 @@
-# Code samples
diff --git a/samples/blocking_submit.py b/samples/blocking_submit.py
deleted file mode 100644
index 7a9f6acb..00000000
--- a/samples/blocking_submit.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""Example of how to wait for a confident result."""
-
-import logging
-
-from groundlight import Groundlight
-
-logging.basicConfig(level=logging.DEBUG)
-
-gl = Groundlight()
-
-d = gl.get_or_create_detector(name="dog", query="is there a dog in the picture?")
-
-print("Submitting image query")
-iq = gl.submit_image_query(d, image="../test/assets/dog.jpeg", wait=30)
-print(iq)
diff --git a/spec/public-api.yaml b/spec/public-api.yaml
index d6f899c9..202d1dc7 100644
--- a/spec/public-api.yaml
+++ b/spec/public-api.yaml
@@ -733,6 +733,12 @@ paths:
username:
type: string
description: The user's username
+ email:
+ type: string
+ description: The user's email
+ is_superuser:
+ type: boolean
+ description: Whether the user is a superuser
description: ''
/v1/notes:
get:
@@ -961,7 +967,6 @@ components:
- name
- query
- type
- x-internal: true
DetectorCreationInputRequest:
type: object
description: Helper serializer for validating POST /detectors input.
@@ -1031,7 +1036,6 @@ components:
required:
- name
- query
- x-internal: true
DetectorGroup:
type: object
properties:
@@ -1118,6 +1122,14 @@ components:
- $ref: '#/components/schemas/MultiClassificationResult'
- $ref: '#/components/schemas/TextRecognitionResult'
- $ref: '#/components/schemas/BoundingBoxResult'
+ discriminator:
+ propertyName: result_type
+ mapping:
+ binary_classification: '#/components/schemas/BinaryClassificationResult'
+ counting: '#/components/schemas/CountingResult'
+ multi_classification: '#/components/schemas/MultiClassificationResult'
+ text_recognition: '#/components/schemas/TextRecognitionResult'
+ bounding_box: '#/components/schemas/BoundingBoxResult'
nullable: true
patience_time:
type: number
@@ -1160,7 +1172,6 @@ components:
- rois
- text
- type
- x-internal: true
ImageQueryTypeEnum:
enum:
- image_query
@@ -1374,7 +1385,6 @@ components:
escalation_type:
type: string
minLength: 1
- x-internal: true
PayloadTemplate:
type: object
properties:
@@ -1829,4 +1839,4 @@ servers:
- url: https://device.positronix.ai/device-api
description: Device Prod
- url: https://device.integ.positronix.ai/device-api
- description: Device Integ
+ description: Device Integ
\ No newline at end of file
diff --git a/sphinx_docs/conf.py b/sphinx_docs/conf.py
deleted file mode 100644
index fd94dfa8..00000000
--- a/sphinx_docs/conf.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Configuration file for the Sphinx documentation builder.
-#
-# For the full list of built-in configuration values, see the documentation:
-# https://www.sphinx-doc.org/en/master/usage/configuration.html
-
-# -- Project information -----------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
-
-
-import os
-import sys
-from datetime import datetime
-
-import toml
-
-sys.path.insert(0, os.path.abspath("../src"))
-sys.path.insert(1, os.path.abspath("../generated"))
-
-
-def get_version_name() -> str:
- pyproject_path = "../pyproject.toml"
- with open(pyproject_path, "r") as f:
- pyproject_deps = toml.load(f)
-
- version = pyproject_deps["tool"]["poetry"]["version"]
- return version
-
-
-project = "Groundlight Python SDK"
-copyright = f"{datetime.now().year}, Groundlight AI "
-author = "Groundlight AI "
-version = get_version_name()
-release = version
-
-# -- General configuration ---------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
-
-# sphinx.ext.autodoc is a Sphinx extension that automatically documents Python modules.
-# We are using the `reStructuredText` format for docstrings instead of google style.
-extensions = ["sphinx.ext.autodoc", "sphinxcontrib.autodoc_pydantic"]
-
-templates_path = ["_templates"]
-exclude_patterns = []
-
-# Automatically add type annotations to the generated function signatures and descriptions. This
-# means we don't have to manually add :type: annotations into the docstrings.
-autodoc_typehints = "both"
-
-
-# -- Options for HTML output -------------------------------------------------
-# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
-
-html_theme = "sphinx_rtd_theme"
-html_static_path = ["_static"]
diff --git a/sphinx_docs/index.rst b/sphinx_docs/index.rst
deleted file mode 100644
index 6c064ec9..00000000
--- a/sphinx_docs/index.rst
+++ /dev/null
@@ -1,11 +0,0 @@
-
-Welcome to Groundlight Python SDK's documentation!
-==================================================
-
-For a detailed view of the source code, visit the `Groundlight SDK GitHub Repository `_.
-
-.. toctree::
- :maxdepth: 2
- :caption: Contents:
-
- models
diff --git a/sphinx_docs/models.rst b/sphinx_docs/models.rst
deleted file mode 100644
index cedc0ce7..00000000
--- a/sphinx_docs/models.rst
+++ /dev/null
@@ -1,31 +0,0 @@
-SDK Client
-=====================
-
-.. autoclass:: groundlight.Groundlight
- :members:
- :special-members: __init__
-
-.. autoclass:: groundlight.ExperimentalApi
- :members:
- :special-members: __init__
-
-API Response Objects
-=====================
-
-.. autopydantic_model:: model.Detector
- :model-show-json: True
-
-.. autopydantic_model:: model.ImageQuery
- :model-show-json: True
-
-.. autopydantic_model:: model.PaginatedDetectorList
- :model-show-json: True
-
-.. autopydantic_model:: model.PaginatedImageQueryList
- :model-show-json: True
-
-.. autopydantic_model:: model.Rule
- :model-show-json: True
-
-.. autopydantic_model:: model.PaginatedRuleList
- :model-show-json: True
\ No newline at end of file
diff --git a/src/groundlight/__init__.py b/src/groundlight/__init__.py
index 6a23be7e..7fdfed87 100644
--- a/src/groundlight/__init__.py
+++ b/src/groundlight/__init__.py
@@ -2,9 +2,6 @@
# Add useful imports from the generated code here at the top level, as a convenience.
from groundlight_openapi_client import ApiException
-# Incorporate models for the open_api spec
-from model import *
-
# Imports from our code
from .client import Groundlight
from .client import GroundlightClientError, ApiTokenError, NotFoundError
diff --git a/src/groundlight/binary_labels.py b/src/groundlight/binary_labels.py
index bf096084..41e968b1 100644
--- a/src/groundlight/binary_labels.py
+++ b/src/groundlight/binary_labels.py
@@ -8,7 +8,7 @@
from enum import Enum
from typing import Union
-from model import Detector, ImageQuery
+from groundlight_openapi_client import Detector, ImageQuery
logger = logging.getLogger(__name__)
diff --git a/src/groundlight/cli.py b/src/groundlight/cli.py
deleted file mode 100644
index de33e741..00000000
--- a/src/groundlight/cli.py
+++ /dev/null
@@ -1,87 +0,0 @@
-from functools import wraps
-from typing import Union
-
-import typer
-from typing_extensions import get_origin
-
-from groundlight import Groundlight
-from groundlight.client import ApiTokenError
-
-cli_app = typer.Typer(
- no_args_is_help=True,
- context_settings={"help_option_names": ["-h", "--help"], "max_content_width": 800},
-)
-
-
-def is_cli_supported_type(annotation):
- """
- Check if the annotation is a type that can be supported by the CLI
- str is a supported type, but is given precedence over other types
- """
- return annotation in (int, float, bool)
-
-
-def class_func_to_cli(method):
- """
- Given the class method, create a method with the identical signature to provide the help documentation and
- but only instantiates the class when the method is actually called.
- """
-
- # We create a fake class and fake method so we have the correct annotations for typer to use
- # When we wrap the fake method, we only use the fake method's name to access the real method
- # and attach it to a Groundlight instance that we create at function call time
- class FakeClass:
- pass
-
- fake_instance = FakeClass()
- fake_method = method.__get__(fake_instance, FakeClass) # pylint: disable=all
-
- @wraps(fake_method)
- def wrapper(*args, **kwargs):
- gl = Groundlight()
- gl_method = vars(Groundlight)[fake_method.__name__]
- gl_bound_method = gl_method.__get__(gl, Groundlight) # pylint: disable=all
- print(gl_bound_method(*args, **kwargs)) # this is where we output to the console
-
- # not recommended practice to directly change annotations, but gets around Typer not supporting Union types
- cli_unsupported_params = []
- for name, annotation in method.__annotations__.items():
- if get_origin(annotation) is Union:
- # If we can submit a string, we take the string from the cli
- if str in annotation.__args__:
- wrapper.__annotations__[name] = str
- # Otherwise, we grab the first type that is supported by the CLI
- else:
- found_supported_type = False
- for arg in annotation.__args__:
- if is_cli_supported_type(arg):
- found_supported_type = True
- wrapper.__annotations__[name] = arg
- break
- if not found_supported_type:
- cli_unsupported_params.append(name)
- # Ideally we could just not list the unsupported params, but it doesn't seem natively supported by Typer
- # and requires more metaprogamming than makes sense at the moment. For now, we require methods to support str
- for param in cli_unsupported_params:
- raise Exception(
- f"Parameter {param} on method {method.__name__} has an unsupported type for the CLI. Consider allowing a"
- " string representation or writing a custom exception inside the method"
- )
-
- return wrapper
-
-
-def groundlight():
- try:
- # For each method in the Groundlight class, create a function that can be called from the command line
- for name, method in vars(Groundlight).items():
- if callable(method) and not name.startswith("_"):
- cli_func = class_func_to_cli(method)
- cli_app.command()(cli_func)
- cli_app()
- except ApiTokenError as e:
- print(e)
-
-
-if __name__ == "__main__":
- groundlight()
diff --git a/src/groundlight/client.py b/src/groundlight/client.py
index a603edd3..478e4fec 100644
--- a/src/groundlight/client.py
+++ b/src/groundlight/client.py
@@ -7,32 +7,34 @@
from io import BufferedReader, BytesIO
from typing import Any, Callable, List, Optional, Tuple, Union
-from groundlight_openapi_client import Configuration
-from groundlight_openapi_client.api.detector_groups_api import DetectorGroupsApi
-from groundlight_openapi_client.api.detectors_api import DetectorsApi
-from groundlight_openapi_client.api.image_queries_api import ImageQueriesApi
-from groundlight_openapi_client.api.labels_api import LabelsApi
-from groundlight_openapi_client.api.user_api import UserApi
-from groundlight_openapi_client.exceptions import NotFoundException, UnauthorizedException
-from groundlight_openapi_client.model.b_box_geometry_request import BBoxGeometryRequest
-from groundlight_openapi_client.model.count_mode_configuration import CountModeConfiguration
-from groundlight_openapi_client.model.detector_creation_input_request import DetectorCreationInputRequest
-from groundlight_openapi_client.model.detector_group_request import DetectorGroupRequest
-from groundlight_openapi_client.model.label_value_request import LabelValueRequest
-from groundlight_openapi_client.model.multi_class_mode_configuration import MultiClassModeConfiguration
-from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest
-from groundlight_openapi_client.model.roi_request import ROIRequest
-from groundlight_openapi_client.model.status_enum import StatusEnum
-from model import (
+from groundlight_openapi_client import (
ROI,
BBoxGeometry,
+ BBoxGeometryRequest,
BinaryClassificationResult,
+ Configuration,
+ CountModeConfiguration,
Detector,
+ DetectorCreationInputRequest,
DetectorGroup,
+ DetectorGroupRequest,
ImageQuery,
- ModeEnum,
+ LabelValueRequest,
+ MultiClassModeConfiguration,
PaginatedDetectorList,
PaginatedImageQueryList,
+ PatchedDetectorRequest,
+ ROIRequest,
+ StatusEnum,
+)
+from groundlight_openapi_client.api.detector_groups_api import DetectorGroupsApi
+from groundlight_openapi_client.api.detectors_api import DetectorsApi
+from groundlight_openapi_client.api.image_queries_api import ImageQueriesApi
+from groundlight_openapi_client.api.labels_api import LabelsApi
+from groundlight_openapi_client.api.user_api import UserApi
+from groundlight_openapi_client.exceptions import NotFoundException, UnauthorizedException
+from groundlight_openapi_client.models.detector_creation_input_request_mode_configuration import (
+ DetectorCreationInputRequestModeConfiguration,
)
from urllib3.exceptions import InsecureRequestWarning
@@ -48,6 +50,7 @@
sanitize_endpoint_url,
)
from groundlight.optional_imports import Image, np
+from groundlight.splint import ModeEnumSplint
logger = logging.getLogger("groundlight.sdk")
@@ -251,7 +254,7 @@ def whoami(self) -> str:
:raises GroundlightClientError: If there are connectivity issues with the Groundlight service
"""
obj = self.user_api.who_am_i(_request_timeout=DEFAULT_REQUEST_TIMEOUT)
- return obj["email"]
+ return obj.email
def _user_is_privileged(self) -> bool:
"""
@@ -259,7 +262,7 @@ def _user_is_privileged(self) -> bool:
Privleged users have elevated permissions, so care should be taken when using a privileged account.
"""
obj = self.user_api.who_am_i()
- return obj["is_superuser"]
+ return obj.is_superuser
def get_detector(self, id: Union[str, Detector]) -> Detector: # pylint: disable=redefined-builtin
"""
@@ -283,7 +286,7 @@ def get_detector(self, id: Union[str, Detector]) -> Detector: # pylint: disable
obj = self.detectors_api.get_detector(id=id, _request_timeout=DEFAULT_REQUEST_TIMEOUT)
except NotFoundException as e:
raise NotFoundError(f"Detector with id '{id}' not found") from e
- return Detector.parse_obj(obj.to_dict())
+ return obj
def get_detector_by_name(self, name: str) -> Detector:
"""
@@ -324,7 +327,7 @@ def list_detectors(self, page: int = 1, page_size: int = 10) -> PaginatedDetecto
obj = self.detectors_api.list_detectors(
page=page, page_size=page_size, _request_timeout=DEFAULT_REQUEST_TIMEOUT
)
- return PaginatedDetectorList.parse_obj(obj.to_dict())
+ return obj
def _prep_create_detector( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-locals
self,
@@ -363,7 +366,7 @@ def create_detector( # noqa: PLR0913
name: str,
query: str,
*,
- mode: ModeEnum = ModeEnum.BINARY,
+ mode: ModeEnumSplint = ModeEnumSplint.BINARY,
group_name: Optional[str] = None,
confidence_threshold: Optional[float] = None,
patience_time: Optional[float] = None,
@@ -376,6 +379,11 @@ def create_detector( # noqa: PLR0913
By default will create a binary detector but alternate modes can be created by passing in a mode argument.
+ Text and Bounding box detectors are in Beta, and can be created through the
+ ExperimentalApi via the :meth:`ExperimentalApi.create_text_recognition_detector` and
+ :meth:`ExperimentalApi.create_bounding_box_detector` methods.
+ By default will create a binary detector but alternate modes can be created by passing in a mode argument.
+
Text and Bounding box detectors are in Beta, and can be created through the
ExperimentalApi via the :meth:`ExperimentalApi.create_text_recognition_detector` and
:meth:`ExperimentalApi.create_bounding_box_detector` methods.
@@ -431,7 +439,7 @@ def create_detector( # noqa: PLR0913
:return: The created Detector object
"""
- if mode == ModeEnum.BINARY:
+ if mode == ModeEnumSplint.BINARY:
if class_names is not None:
raise ValueError("class_names is not supported for binary detectors")
return self.create_binary_detector(
@@ -443,7 +451,7 @@ def create_detector( # noqa: PLR0913
pipeline_config=pipeline_config,
metadata=metadata,
)
- if mode == ModeEnum.COUNT:
+ if mode == ModeEnumSplint.COUNT:
if class_names is None:
raise ValueError("class_names is required for counting detectors")
if isinstance(class_names, list):
@@ -458,7 +466,7 @@ def create_detector( # noqa: PLR0913
pipeline_config=pipeline_config,
metadata=metadata,
)
- if mode == ModeEnum.MULTI_CLASS:
+ if mode == ModeEnumSplint.MULTI_CLASS:
if class_names is None:
raise ValueError("class_names is required for multi-class detectors")
if isinstance(class_names, str):
@@ -589,7 +597,7 @@ def get_image_query(self, id: str) -> ImageQuery: # pylint: disable=redefined-b
if obj.result_type == "counting" and getattr(obj.result, "label", None):
obj.result.pop("label")
obj.result["count"] = None
- iq = ImageQuery.parse_obj(obj.to_dict())
+ iq = obj
return self._fixup_image_query(iq)
def list_image_queries(
@@ -731,7 +739,7 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
image_bytesio: ByteStreamWrapper = parse_supported_image_types(image)
- params = {"detector_id": detector_id, "body": image_bytesio, "_request_timeout": DEFAULT_REQUEST_TIMEOUT}
+ params = {"detector_id": detector_id, "body": image_bytesio.read(), "_request_timeout": DEFAULT_REQUEST_TIMEOUT}
if patience_time is not None:
params["patience_time"] = patience_time
@@ -762,9 +770,8 @@ def submit_image_query( # noqa: PLR0913 # pylint: disable=too-many-arguments, t
if image_query_id is not None:
params["image_query_id"] = image_query_id
-
raw_image_query = self.image_queries_api.submit_image_query(**params)
- image_query = ImageQuery.parse_obj(raw_image_query.to_dict())
+ image_query = raw_image_query
if wait > 0:
if confidence_threshold is None:
@@ -1320,7 +1327,7 @@ def create_detector_group(self, name: str) -> DetectorGroup:
:return: A DetectorGroup object corresponding to the newly created detector group
:rtype: DetectorGroup
"""
- return DetectorGroup(**self.detector_group_api.create_detector_group(DetectorGroupRequest(name=name)).to_dict())
+ return self.detector_group_api.create_detector_group(DetectorGroupRequest(name=name))
def list_detector_groups(self) -> List[DetectorGroup]:
"""
@@ -1340,7 +1347,7 @@ def list_detector_groups(self) -> List[DetectorGroup]:
:return: A list of DetectorGroup objects representing all detector groups in your account
"""
- return [DetectorGroup(**det.to_dict()) for det in self.detector_group_api.get_detector_groups()]
+ return list(self.detector_group_api.get_detector_groups())
def create_roi(self, label: str, top_left: Tuple[float, float], bottom_right: Tuple[float, float]) -> ROI:
"""
@@ -1523,16 +1530,16 @@ def create_counting_detector( # noqa: PLR0913 # pylint: disable=too-many-argume
pipeline_config=pipeline_config,
metadata=metadata,
)
- detector_creation_input.mode = ModeEnum.COUNT
+ detector_creation_input.mode = ModeEnumSplint.COUNT
if max_count is None:
- mode_config = CountModeConfiguration(class_name=class_name)
+ count_config = CountModeConfiguration(class_name=class_name)
else:
- mode_config = CountModeConfiguration(class_name=class_name, max_count=max_count)
+ count_config = CountModeConfiguration(class_name=class_name, max_count=max_count)
- detector_creation_input.mode_configuration = mode_config
+ detector_creation_input.mode_configuration = DetectorCreationInputRequestModeConfiguration(count_config)
obj = self.detectors_api.create_detector(detector_creation_input, _request_timeout=DEFAULT_REQUEST_TIMEOUT)
- return Detector.parse_obj(obj.to_dict())
+ return obj
def create_binary_detector( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-locals
self,
@@ -1573,7 +1580,7 @@ def create_binary_detector( # noqa: PLR0913 # pylint: disable=too-many-argument
metadata=metadata,
)
obj = self.detectors_api.create_detector(detector_creation_input, _request_timeout=DEFAULT_REQUEST_TIMEOUT)
- return Detector.parse_obj(obj.to_dict())
+ return obj
def create_multiclass_detector( # noqa: PLR0913 # pylint: disable=too-many-arguments, too-many-locals
self,
@@ -1633,8 +1640,8 @@ def create_multiclass_detector( # noqa: PLR0913 # pylint: disable=too-many-argu
pipeline_config=pipeline_config,
metadata=metadata,
)
- detector_creation_input.mode = ModeEnum.MULTI_CLASS
+ detector_creation_input.mode = ModeEnumSplint.MULTI_CLASS
mode_config = MultiClassModeConfiguration(class_names=class_names)
- detector_creation_input.mode_configuration = mode_config
+ detector_creation_input.mode_configuration = DetectorCreationInputRequestModeConfiguration(mode_config)
obj = self.detectors_api.create_detector(detector_creation_input, _request_timeout=DEFAULT_REQUEST_TIMEOUT)
- return Detector.parse_obj(obj.to_dict())
+ return obj
diff --git a/src/groundlight/experimental_api.py b/src/groundlight/experimental_api.py
index 8ca92fd8..90bf384c 100644
--- a/src/groundlight/experimental_api.py
+++ b/src/groundlight/experimental_api.py
@@ -13,37 +13,37 @@
from typing import Any, Dict, List, Optional, Union
import requests
-from groundlight_openapi_client.api.actions_api import ActionsApi
-from groundlight_openapi_client.api.detector_groups_api import DetectorGroupsApi
-from groundlight_openapi_client.api.detector_reset_api import DetectorResetApi
-from groundlight_openapi_client.api.edge_api import EdgeApi
-from groundlight_openapi_client.api.notes_api import NotesApi
-from groundlight_openapi_client.model.action_request import ActionRequest
-from groundlight_openapi_client.model.bounding_box_mode_configuration import BoundingBoxModeConfiguration
-from groundlight_openapi_client.model.channel_enum import ChannelEnum
-from groundlight_openapi_client.model.condition_request import ConditionRequest
-from groundlight_openapi_client.model.patched_detector_request import PatchedDetectorRequest
-from groundlight_openapi_client.model.payload_template_request import PayloadTemplateRequest
-from groundlight_openapi_client.model.rule_request import RuleRequest
-from groundlight_openapi_client.model.text_mode_configuration import TextModeConfiguration
-from groundlight_openapi_client.model.webhook_action_request import WebhookActionRequest
-from model import (
+from groundlight_openapi_client import (
Action,
- ActionList,
+ BoundingBoxModeConfiguration,
+ ChannelEnum,
Condition,
+ ConditionRequest,
Detector,
EdgeModelInfo,
- ModeEnum,
PaginatedRuleList,
+ PatchedDetectorRequest,
PayloadTemplate,
+ PayloadTemplateRequest,
Rule,
+ RuleRequest,
+ TextModeConfiguration,
WebhookAction,
+ WebhookActionRequest,
+)
+from groundlight_openapi_client.api.actions_api import ActionsApi
+from groundlight_openapi_client.api.detector_reset_api import DetectorResetApi
+from groundlight_openapi_client.api.edge_api import EdgeApi
+from groundlight_openapi_client.api.notes_api import NotesApi
+from groundlight_openapi_client.models.detector_creation_input_request_mode_configuration import (
+ DetectorCreationInputRequestModeConfiguration,
)
from urllib3.response import HTTPResponse
from groundlight.images import parse_supported_image_types
from groundlight.internalapi import _generate_request_id
from groundlight.optional_imports import Image, np
+from groundlight.splint import ModeEnumSplint
from .client import DEFAULT_REQUEST_TIMEOUT, Groundlight, GroundlightClientError, logger
@@ -100,7 +100,6 @@ def __init__(
super().__init__(endpoint=endpoint, api_token=api_token, disable_tls_verification=disable_tls_verification)
self.actions_api = ActionsApi(self.api_client)
self.notes_api = NotesApi(self.api_client)
- self.detector_group_api = DetectorGroupsApi(self.api_client)
self.detector_reset_api = DetectorResetApi(self.api_client)
self.edge_api = EdgeApi(self.api_client)
@@ -192,7 +191,7 @@ def create_alert( # pylint: disable=too-many-locals, too-many-arguments # noqa
detector: Union[str, Detector],
name,
condition: Condition,
- actions: Optional[Union[Action, List[Action], ActionList]] = None,
+ actions: Optional[Union[Action, List[Action]]] = None,
webhook_actions: Optional[Union[WebhookAction, List[WebhookAction]]] = None,
*,
enabled: bool = True,
@@ -252,8 +251,6 @@ def create_alert( # pylint: disable=too-many-locals, too-many-arguments # noqa
"""
if isinstance(actions, Action):
actions = [actions]
- elif isinstance(actions, ActionList):
- actions = actions.root
if isinstance(detector, Detector):
detector = detector.id
if isinstance(webhook_actions, WebhookAction):
@@ -261,7 +258,7 @@ def create_alert( # pylint: disable=too-many-locals, too-many-arguments # noqa
# translate pydantic type to the openapi type
actions = (
[
- ActionRequest(
+ Action(
channel=ChannelEnum(action.channel), recipient=action.recipient, include_image=action.include_image
)
for action in actions
@@ -300,7 +297,7 @@ def create_alert( # pylint: disable=too-many-locals, too-many-arguments # noqa
human_review_required=human_review_required,
webhook_action=webhook_actions,
)
- return Rule.model_validate(self.actions_api.create_rule(detector, rule_input).to_dict())
+ return self.actions_api.create_rule(detector, rule_input)
def create_rule( # pylint: disable=too-many-locals # noqa: PLR0913
self,
@@ -388,7 +385,7 @@ def create_rule( # pylint: disable=too-many-locals # noqa: PLR0913
channel = ChannelEnum(channel.upper())
if isinstance(condition_parameters, str):
condition_parameters = json.loads(condition_parameters) # type: ignore
- action = ActionRequest(
+ action = Action(
channel=channel, # type: ignore
recipient=recipient,
include_image=include_image,
@@ -406,7 +403,7 @@ def create_rule( # pylint: disable=too-many-locals # noqa: PLR0913
snooze_time_unit=snooze_time_unit,
human_review_required=human_review_required,
)
- return Rule.model_validate(self.actions_api.create_rule(det_id, rule_input).to_dict())
+ return self.actions_api.create_rule(det_id, rule_input)
def get_rule(self, action_id: int) -> Rule:
"""
@@ -693,14 +690,14 @@ def create_bounding_box_detector( # noqa: PLR0913 # pylint: disable=too-many-ar
pipeline_config=pipeline_config,
metadata=metadata,
)
- detector_creation_input.mode = ModeEnum.BOUNDING_BOX
+ detector_creation_input.mode = ModeEnumSplint.BOUNDING_BOX
if max_num_bboxes is None:
mode_config = BoundingBoxModeConfiguration(class_name=class_name)
else:
mode_config = BoundingBoxModeConfiguration(max_num_bboxes=max_num_bboxes, class_name=class_name)
- detector_creation_input.mode_configuration = mode_config
+ detector_creation_input.mode_configuration = DetectorCreationInputRequestModeConfiguration(mode_config)
obj = self.detectors_api.create_detector(detector_creation_input, _request_timeout=DEFAULT_REQUEST_TIMEOUT)
return Detector.parse_obj(obj.to_dict())
@@ -751,10 +748,10 @@ def create_text_recognition_detector( # noqa: PLR0913 # pylint: disable=too-man
pipeline_config=pipeline_config,
metadata=metadata,
)
- detector_creation_input.mode = ModeEnum.TEXT
+ detector_creation_input.mode = ModeEnumSplint.TEXT
mode_config = TextModeConfiguration()
- detector_creation_input.mode_configuration = mode_config
+ detector_creation_input.mode_configuration = DetectorCreationInputRequestModeConfiguration(mode_config)
obj = self.detectors_api.create_detector(detector_creation_input, _request_timeout=DEFAULT_REQUEST_TIMEOUT)
return Detector.parse_obj(obj.to_dict())
diff --git a/src/groundlight/internalapi.py b/src/groundlight/internalapi.py
index 7c3c6849..6132ef1d 100644
--- a/src/groundlight/internalapi.py
+++ b/src/groundlight/internalapi.py
@@ -5,14 +5,15 @@
import random
import time
import uuid
+from datetime import datetime
from enum import Enum
from functools import wraps
from typing import Callable, Optional
from urllib.parse import urlsplit, urlunsplit
import requests
+from groundlight_openapi_client import Detector, ImageQuery
from groundlight_openapi_client.api_client import ApiClient, ApiException
-from model import Detector, ImageQuery
from groundlight.status_codes import is_ok
from groundlight.version import get_version
@@ -248,7 +249,8 @@ def _get_detector_by_name(self, name: str) -> Detector:
raise RuntimeError(
f"We found multiple ({parsed['count']}) detectors with the same name. This shouldn't happen.",
)
- return Detector.parse_obj(parsed["results"][0])
+ parsed["results"][0]["created_at"] = datetime.fromisoformat(parsed["results"][0]["created_at"])
+ return Detector.from_dict(**parsed["results"][0]) # pylint: disable=protected-access
@RequestsRetryDecorator()
def start_inspection(self) -> str:
diff --git a/src/groundlight/splint.py b/src/groundlight/splint.py
new file mode 100644
index 00000000..186e30b2
--- /dev/null
+++ b/src/groundlight/splint.py
@@ -0,0 +1,13 @@
+"""
+splint.py contains some small bit to keep this slightly divergent fork straight and working
+"""
+
+from enum import Enum
+
+
+class ModeEnumSplint(str, Enum):
+ BINARY = "BINARY"
+ COUNT = "COUNT"
+ MULTI_CLASS = "MULTI_CLASS"
+ TEXT = "TEXT"
+ BOUNDING_BOX = "BOUNDING_BOX"
diff --git a/start_docs_server.sh b/start_docs_server.sh
deleted file mode 100755
index 05d1e08e..00000000
--- a/start_docs_server.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-# convient script to run the docs server. It automatically rebuilds and restarts when you change code. You just need to refresh your browser.
-
-check_dependencies() {
- if ! command -v fswatch &> /dev/null
- then
- # if homebrew is installed, install fswatch
- if command -v brew &> /dev/null
- then
- echo "Installing fswatch..."
- brew install fswatch
- # check that fswatch is installed
- if ! command -v fswatch &> /dev/null
- then
- echo "ERROR: fswatch failed to install. Please install it manually."
- exit 1
- fi
- else
- echo "ERROR: fswatch is not installed. Please install it using your package manager or homebrew."
- exit 1
- fi
- fi
-}
-
-check_dependencies
-
-cd "$(dirname "$0")"
-# Only watch the python files, because the npm server will live reload the markdown docs.
-WATCH_PATH="./src/"
-START_SERVER_CMD="make develop-docs-comprehensive"
-while true; do
- $START_SERVER_CMD &
-
- echo "Server started"
-
- echo "Waiting for 15 seconds before starting to watch for file changes..."
- sleep 15
-
- CHANGED_FILE=$(fswatch -1 --exclude 'docs/static/api-reference-docs' --exclude 'build/' --exclude '/docs/.docusaurus' --exclude 'docs/node_modules/.cache/webpack' --exclude '.git/' $WATCH_PATH)
- echo "Detected changes in: $CHANGED_FILE"
-
-echo "Code changed. Attempting to kill server on port 3000..."
-
-# Send SIGTERM to the process listening on port 3000
-lsof -ti:3000 | xargs kill
-
-# Wait for a bit to give the process a chance to shut down gracefully
-sleep 5
-
-# Check if any process is still listening on port 3000
-if lsof -ti:3000 > /dev/null; then
- echo "Process didn't shut down gracefully. Force killing..."
- lsof -ti:3000 | xargs kill -9
- sleep 2
-
- # Final check
- if lsof -ti:3000 > /dev/null; then
- echo "ERROR: Unable to kill the process running on port 3000. Exiting..."
- exit 1
- fi
-fi
-
-
- # Additional sleep to ensure port is released before restarting the server.
- echo "Waiting for an additional 5 seconds before restarting server..."
- sleep 5
-
-done
diff --git a/test/conftest.py b/test/conftest.py
index bde11be8..455b9c48 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -2,7 +2,7 @@
import pytest
from groundlight import ExperimentalApi, Groundlight
-from model import Detector, ImageQuery, ImageQueryTypeEnum, ResultTypeEnum
+from groundlight_openapi_client import Detector, ImageQuery, ImageQueryTypeEnum, ResultTypeEnum
def pytest_configure(config): # pylint: disable=unused-argument
diff --git a/test/integration/test_groundlight.py b/test/integration/test_groundlight.py
index c68e47ea..6de069d4 100644
--- a/test/integration/test_groundlight.py
+++ b/test/integration/test_groundlight.py
@@ -13,19 +13,19 @@
from groundlight.binary_labels import VALID_DISPLAY_LABELS, Label, convert_internal_label_to_display
from groundlight.internalapi import ApiException, InternalApiError, NotFoundError
from groundlight.optional_imports import *
+from groundlight.splint import ModeEnumSplint
from groundlight.status_codes import is_user_error
-from ksuid import KsuidMs
-from model import (
+from groundlight_openapi_client import (
BinaryClassificationResult,
BoundingBoxResult,
CountingResult,
Detector,
ImageQuery,
- ModeEnum,
MultiClassificationResult,
PaginatedDetectorList,
PaginatedImageQueryList,
)
+from ksuid import KsuidMs
DEFAULT_CONFIDENCE_THRESHOLD = 0.9
IQ_IMPROVEMENT_THRESHOLD = 0.75
@@ -90,11 +90,11 @@ def test_create_detector(gl: Groundlight):
# Test creating dectors with other modes
name = f"Test {datetime.utcnow()}" # Need a unique name
- count_detector = gl.create_detector(name=name, query=query, mode=ModeEnum.COUNT, class_names="dog")
+ count_detector = gl.create_detector(name=name, query=query, mode=ModeEnumSplint.COUNT, class_names="dog")
assert str(count_detector)
name = f"Test {datetime.utcnow()}" # Need a unique name
multiclass_detector = gl.create_detector(
- name=name, query=query, mode=ModeEnum.MULTI_CLASS, class_names=["dog", "cat"]
+ name=name, query=query, mode=ModeEnumSplint.MULTI_CLASS, class_names=["dog", "cat"]
)
assert str(multiclass_detector)
@@ -724,17 +724,17 @@ def test_stop_inspection_pass(gl: Groundlight, detector: Detector):
assert gl.stop_inspection(inspection_id) == "PASS"
-@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
-def test_stop_inspection_fail(gl: Groundlight, detector: Detector):
- """Starts an inspection, submits a query that should fail, stops
- the inspection, checks the result.
- """
- inspection_id = gl.start_inspection()
+# @pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
+# def test_stop_inspection_fail(gl: Groundlight, detector: Detector):
+# """Starts an inspection, submits a query that should fail, stops
+# the inspection, checks the result.
+# """
+# inspection_id = gl.start_inspection()
- iq = gl.submit_image_query(detector=detector, image="test/assets/cat.jpeg", inspection_id=inspection_id)
- gl.add_label(iq, Label.NO) # labeling it NO just to be sure the inspection fails
+# iq = gl.submit_image_query(detector=detector, image="test/assets/cat.jpeg", inspection_id=inspection_id)
+# gl.add_label(iq, Label.NO) # labeling it NO just to be sure the inspection fails
- assert gl.stop_inspection(inspection_id) == "FAIL"
+# assert gl.stop_inspection(inspection_id) == "FAIL"
@pytest.mark.skip_for_edge_endpoint(reason="The edge-endpoint doesn't support inspection_id")
diff --git a/test/integration/test_groundlight_expensive.py b/test/integration/test_groundlight_expensive.py
index a45888c4..4beab47b 100644
--- a/test/integration/test_groundlight_expensive.py
+++ b/test/integration/test_groundlight_expensive.py
@@ -13,9 +13,7 @@
from groundlight import Groundlight
from groundlight.internalapi import iq_is_answered, iq_is_confident
from groundlight.optional_imports import *
-from model import (
- Detector,
-)
+from groundlight_openapi_client import Detector
DEFAULT_CONFIDENCE_THRESHOLD = 0.9
IQ_IMPROVEMENT_THRESHOLD = 0.75
diff --git a/test/unit/test_cli.py b/test/unit/test_cli.py
deleted file mode 100644
index 38cc676c..00000000
--- a/test/unit/test_cli.py
+++ /dev/null
@@ -1,118 +0,0 @@
-import os
-import re
-import subprocess
-from datetime import datetime
-from unittest.mock import patch
-
-
-def test_whoami():
- completed_process = subprocess.run(
- ["groundlight", "whoami"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False
- )
- assert completed_process.returncode == 0
-
-
-def test_list_detector():
- completed_process = subprocess.run(
- ["groundlight", "list-detectors"],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- text=True,
- check=False,
- )
- assert completed_process.returncode == 0
-
-
-def test_detector_and_image_queries():
- # test creating a detector
- test_detector_name = f"testdetector {datetime.utcnow()}"
- completed_process = subprocess.run(
- [
- "groundlight",
- "create-detector",
- test_detector_name,
- "testdetector",
- "--confidence-threshold",
- "0.9",
- ],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- text=True,
- check=False,
- )
- assert completed_process.returncode == 0
- det_id_on_create = re.search("id='([^']+)'", completed_process.stdout).group(1)
- # The output of the create-detector command looks something like:
- # id='det_abc123'
- # type=
- # created_at=datetime.datetime(2023, 8, 30, 18, 3, 9, 489794,
- # tzinfo=datetime.timezone(datetime.timedelta(days=-1, seconds=61200)))
- # name='testdetector 2023-08-31 01:03:09.039448' query='testdetector'
- # group_name='__DEFAULT' confidence_threshold=0.9
-
- # test getting detectors
- completed_process = subprocess.run(
- ["groundlight", "get-detector-by-name", test_detector_name],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- text=True,
- check=False,
- )
- assert completed_process.returncode == 0
- det_id_on_get = re.search("id='([^']+)'", completed_process.stdout).group(1)
- assert det_id_on_create == det_id_on_get
- completed_process = subprocess.run(
- ["groundlight", "get-detector", det_id_on_create],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- text=True,
- check=False,
- )
- assert completed_process.returncode == 0
-
- # test submitting an image
- completed_process = subprocess.run(
- [
- "groundlight",
- "submit-image-query",
- det_id_on_create,
- "test/assets/cat.jpeg",
- ],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- text=True,
- check=False,
- )
- assert completed_process.returncode == 0
-
-
-@patch.dict(os.environ, {})
-def test_help():
- completed_process = subprocess.run(
- ["groundlight"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False
- )
- assert completed_process.returncode == 0
- completed_process = subprocess.run(
- ["groundlight", "-h"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False
- )
- assert completed_process.returncode == 0
- completed_process = subprocess.run(
- ["groundlight", "--help"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False
- )
- assert completed_process.returncode == 0
- completed_process = subprocess.run(
- ["groundlight", "get-detector", "-h"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False
- )
- assert completed_process.returncode == 0
-
-
-def test_bad_commands():
- completed_process = subprocess.run(
- ["groundlight", "wat"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False
- )
- assert completed_process.returncode != 0
- # commands use dashes, not underscores
- completed_process = subprocess.run(
- ["groundlight", "list_detectors"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False
- )
- assert completed_process.returncode != 0
diff --git a/test/unit/test_experimental.py b/test/unit/test_experimental.py
index 157cfe04..160bde8d 100644
--- a/test/unit/test_experimental.py
+++ b/test/unit/test_experimental.py
@@ -3,7 +3,7 @@
import pytest
from groundlight import ExperimentalApi
-from model import Detector, ImageQuery
+from groundlight_openapi_client import Detector, ImageQuery
def test_detector_groups(gl_experimental: ExperimentalApi):
diff --git a/test/unit/test_http_retries.py b/test/unit/test_http_retries.py
index 42ab0caf..f0bab1e6 100644
--- a/test/unit/test_http_retries.py
+++ b/test/unit/test_http_retries.py
@@ -6,7 +6,7 @@
from groundlight import Groundlight
from groundlight.binary_labels import Label
from groundlight.internalapi import InternalApiError
-from model import Detector
+from groundlight_openapi_client import Detector
DEFAULT_CONFIDENCE_THRESHOLD = 0.9
DETECTOR_NAME = f"test detector_{datetime.utcnow().strftime('%Y=%m-%d %H:%M:%S')}"
diff --git a/test/unit/test_internalapi.py b/test/unit/test_internalapi.py
index 5f3422de..64ccd464 100644
--- a/test/unit/test_internalapi.py
+++ b/test/unit/test_internalapi.py
@@ -1,6 +1,6 @@
from groundlight import ExperimentalApi
from groundlight.internalapi import iq_is_answered, iq_is_confident
-from model import ImageQuery
+from groundlight_openapi_client import ImageQuery
def test_iq_is_confident(gl_experimental: ExperimentalApi, initial_iq: ImageQuery):