Skip to content

Commit

Permalink
add forgotten model files
Browse files Browse the repository at this point in the history
  • Loading branch information
japrescott committed Oct 10, 2024
1 parent d0300f9 commit b08fa7d
Show file tree
Hide file tree
Showing 2 changed files with 139 additions and 0 deletions.
92 changes: 92 additions & 0 deletions lightly/openapi_generated/swagger_client/models/consent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# coding: utf-8

"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""


from __future__ import annotations
import pprint
import re # noqa: F401
import json


from typing import Optional
try:
# Pydantic >=v1.10.17
from pydantic.v1 import BaseModel, Field, StrictBool, conint
except ImportError:
# Pydantic v1
from pydantic import BaseModel, Field, StrictBool, conint

class Consent(BaseModel):
"""
Consent
"""
accepted_newsletter: Optional[StrictBool] = Field(None, alias="acceptedNewsletter")
accepted_terms_date: Optional[conint(strict=True, ge=0)] = Field(None, alias="acceptedTermsDate", description="unix timestamp in milliseconds")
additional_properties: Dict[str, Any] = {}
__properties = ["acceptedNewsletter", "acceptedTermsDate"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = "forbid"

def to_str(self, by_alias: bool = False) -> str:
"""Returns the string representation of the model"""
return pprint.pformat(self.dict(by_alias=by_alias))

def to_json(self, by_alias: bool = False) -> str:
"""Returns the JSON representation of the model"""
return json.dumps(self.to_dict(by_alias=by_alias))

@classmethod
def from_json(cls, json_str: str) -> Consent:
"""Create an instance of Consent from a JSON string"""
return cls.from_dict(json.loads(json_str))

def to_dict(self, by_alias: bool = False):
"""Returns the dictionary representation of the model"""
_dict = self.dict(by_alias=by_alias,
exclude={
"additional_properties"
},
exclude_none=True)
# puts key-value pairs in additional_properties in the top level
if self.additional_properties is not None:
for _key, _value in self.additional_properties.items():
_dict[_key] = _value

return _dict

@classmethod
def from_dict(cls, obj: dict) -> Consent:
"""Create an instance of Consent from a dict"""
if obj is None:
return None

if not isinstance(obj, dict):
return Consent.parse_obj(obj)

_obj = Consent.parse_obj({
"accepted_newsletter": obj.get("acceptedNewsletter"),
"accepted_terms_date": obj.get("acceptedTermsDate")
})
# store additional fields in additional_properties
for _key in obj.keys():
if _key not in cls.__properties:
_obj.additional_properties[_key] = obj.get(_key)

return _obj

47 changes: 47 additions & 0 deletions lightly/openapi_generated/swagger_client/models/usage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# coding: utf-8

"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
The version of the OpenAPI document: 1.0.0
Contact: [email protected]
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
"""


import json
import pprint
import re # noqa: F401
from enum import Enum
from aenum import no_arg # type: ignore





class Usage(str, Enum):
"""
Usage
"""

"""
allowed enum values
"""
LABELING = 'LABELING'
SELECTING = 'SELECTING'
VISUALIZATION = 'VISUALIZATION'
MODEL_TRAINING = 'MODEL_TRAINING'
DATASET_MANAGING = 'DATASET_MANAGING'
CHECKING_THE_TOOL = 'CHECKING_THE_TOOL'
OTHER = 'OTHER'

@classmethod
def from_json(cls, json_str: str) -> 'Usage':
"""Create an instance of Usage from a JSON string"""
return Usage(json.loads(json_str))


0 comments on commit b08fa7d

Please sign in to comment.