Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ docs/BoundingBoxLabelEnum.md
docs/BoundingBoxModeConfiguration.md
docs/BoundingBoxResult.md
docs/ChannelEnum.md
docs/CustomerGroup.md
docs/Condition.md
docs/ConditionRequest.md
docs/CountModeConfiguration.md
Expand All @@ -40,14 +41,14 @@ 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
docs/LabelsApi.md
docs/MLPipeline.md
docs/Me.md
docs/ModeEnum.md
docs/MonthToDateAccountInfoApi.md
docs/MultiClassModeConfiguration.md
Expand Down Expand Up @@ -129,6 +130,7 @@ 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/customer_group.py
groundlight_openapi_client/model/detector.py
groundlight_openapi_client/model/detector_creation_input_request.py
groundlight_openapi_client/model/detector_group.py
Expand All @@ -142,12 +144,12 @@ 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/me.py
groundlight_openapi_client/model/ml_pipeline.py
groundlight_openapi_client/model/mode_enum.py
groundlight_openapi_client/model/multi_class_mode_configuration.py
Expand Down
3 changes: 2 additions & 1 deletion generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ Class | Method | HTTP request | Description
- [InlineResponse200](docs/InlineResponse200.md)
- [InlineResponse2001](docs/InlineResponse2001.md)
- [InlineResponse2001EvaluationResults](docs/InlineResponse2001EvaluationResults.md)
- [InlineResponse2002](docs/InlineResponse2002.md)
- [CustomerGroup](docs/CustomerGroup.md)
- [Me](docs/Me.md)
- [InlineResponse200Summary](docs/InlineResponse200Summary.md)
- [InlineResponse200SummaryClassCounts](docs/InlineResponse200SummaryClassCounts.md)
- [Label](docs/Label.md)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# InlineResponse2002
# CustomerGroup

A Groundlight customer group (tenant) the authenticated user belongs to.

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**username** | **str** | The user's username | [optional]
**id** | **int** | Numeric id of the customer group. |
**name** | **str** | Name of the customer group. |
**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)
Expand Down
16 changes: 16 additions & 0 deletions generated/docs/Me.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Me

Authenticated user identity from GET /v1/me (id, email, username, groups).

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | Numeric id of the authenticated user. |
**email** | **str** | Email address of the authenticated user. |
**username** | **str** | Username of the authenticated user. |
**groups** | [**[CustomerGroup]**](CustomerGroup.md) | Customer groups the authenticated user belongs to. |
**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)


8 changes: 4 additions & 4 deletions generated/docs/UserApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Method | HTTP request | Description


# **who_am_i**
> InlineResponse2002 who_am_i()
> Me who_am_i()



Retrieve the current user.
Retrieve the authenticated user's id, email, username, and customer groups.

### Example

Expand All @@ -22,7 +22,7 @@ Retrieve the current user.
import time
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.model.me import Me
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.
Expand Down Expand Up @@ -60,7 +60,7 @@ This endpoint does not need any parameter.

### Return type

[**InlineResponse2002**](InlineResponse2002.md)
[**Me**](Me.md)

### Authorization

Expand Down
8 changes: 4 additions & 4 deletions generated/groundlight_openapi_client/api/user_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
none_type,
validate_and_convert_types,
)
from groundlight_openapi_client.model.inline_response2002 import InlineResponse2002
from groundlight_openapi_client.model.me import Me


class UserApi(object):
Expand All @@ -37,7 +37,7 @@ def __init__(self, api_client=None):
self.api_client = api_client
self.who_am_i_endpoint = _Endpoint(
settings={
"response_type": (InlineResponse2002,),
"response_type": (Me,),
"auth": ["ApiToken"],
"endpoint_path": "/v1/me",
"operation_id": "who_am_i",
Expand All @@ -63,7 +63,7 @@ def __init__(self, api_client=None):
def who_am_i(self, **kwargs):
"""who_am_i # noqa: E501

Retrieve the current user. # noqa: E501
Retrieve the authenticated user's id, email, username, and customer groups. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True

Expand Down Expand Up @@ -100,7 +100,7 @@ def who_am_i(self, **kwargs):
async_req (bool): execute request asynchronously

Returns:
InlineResponse2002
Me
If the method is called asynchronously, returns the request
thread.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Generated by: https://openapi-generator.tech
"""


import re # noqa: F401
import sys # noqa: F401

Expand All @@ -24,12 +25,13 @@
file_type,
none_type,
validate_get_composed_info,
OpenApiModel,
OpenApiModel
)
from groundlight_openapi_client.exceptions import ApiAttributeError


class InlineResponse2002(ModelNormal):

class CustomerGroup(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech

Expand All @@ -53,27 +55,19 @@ class InlineResponse2002(ModelNormal):
as additional properties values.
"""

allowed_values = {}
allowed_values = {
}

validations = {}
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
return (bool, date, datetime, dict, float, int, list, str, none_type,) # noqa: E501

_nullable = False

Expand All @@ -88,25 +82,33 @@ def openapi_types():
and the value is attribute type.
"""
return {
"username": (str,), # noqa: E501
'id': (int,), # noqa: E501
'name': (str,), # noqa: E501
}

@cached_property
def discriminator():
return None


attribute_map = {
"username": "username", # noqa: E501
'id': 'id', # noqa: E501
'name': 'name', # noqa: E501
}

read_only_vars = {}
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
def _from_openapi_data(cls, id, name, *args, **kwargs): # noqa: E501
"""CustomerGroup - a model defined in OpenAPI

Args:
id (int): Numeric id of the customer group.
name (str): Name of the customer group.

Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down Expand Up @@ -139,21 +141,19 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
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", ())
_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."
% (
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
Expand All @@ -168,30 +168,34 @@ def _from_openapi_data(cls, *args, **kwargs): # noqa: E501
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
):
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",
'_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
def __init__(self, id, name, *args, **kwargs): # noqa: E501
"""CustomerGroup - a model defined in OpenAPI

Args:
id (int): Numeric id of the customer group.
name (str): Name of the customer group.

Keyword Args:
_check_type (bool): if True, values for parameters in openapi_types
Expand Down Expand Up @@ -224,19 +228,17 @@ def __init__(self, *args, **kwargs): # noqa: E501
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", ())
_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."
% (
"Invalid positional arguments=%s passed to %s. Remove those invalid positional arguments." % (
args,
self.__class__.__name__,
),
Expand All @@ -251,18 +253,16 @@ def __init__(self, *args, **kwargs): # noqa: E501
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
):
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."
)
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")
Loading
Loading