Skip to content

Commit

Permalink
generate configv4
Browse files Browse the repository at this point in the history
  • Loading branch information
japrescott committed Jan 22, 2024
1 parent 1412a78 commit 17e1038
Show file tree
Hide file tree
Showing 16 changed files with 1,614 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# 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 pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.docker_worker_config_omni_vx_create_request_base import DockerWorkerConfigOmniVXCreateRequestBase
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2 import DockerWorkerConfigV2

class DockerWorkerConfigOmniV2CreateRequest(DockerWorkerConfigOmniVXCreateRequestBase):
"""
DockerWorkerConfigOmniV2CreateRequest
"""
config: DockerWorkerConfigV2 = Field(...)
__properties = ["version", "creator", "config"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = 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) -> DockerWorkerConfigOmniV2CreateRequest:
"""Create an instance of DockerWorkerConfigOmniV2CreateRequest 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={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
return _dict

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

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

# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigOmniV2CreateRequest) in the input: " + str(obj))

_obj = DockerWorkerConfigOmniV2CreateRequest.parse_obj({
"version": obj.get("version"),
"creator": obj.get("creator"),
"config": DockerWorkerConfigV2.from_dict(obj.get("config")) if obj.get("config") is not None else None
})
return _obj

Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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 pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2 import DockerWorkerConfigV2

class DockerWorkerConfigOmniV2CreateRequestAllOf(BaseModel):
"""
DockerWorkerConfigOmniV2CreateRequestAllOf
"""
config: DockerWorkerConfigV2 = Field(...)
__properties = ["config"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = 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) -> DockerWorkerConfigOmniV2CreateRequestAllOf:
"""Create an instance of DockerWorkerConfigOmniV2CreateRequestAllOf 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={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
return _dict

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

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

# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigOmniV2CreateRequestAllOf) in the input: " + str(obj))

_obj = DockerWorkerConfigOmniV2CreateRequestAllOf.parse_obj({
"config": DockerWorkerConfigV2.from_dict(obj.get("config")) if obj.get("config") is not None else None
})
return _obj

Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# 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
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.docker_worker_config_omni_vx_data_base import DockerWorkerConfigOmniVXDataBase
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2 import DockerWorkerConfigV2

class DockerWorkerConfigOmniV2Data(DockerWorkerConfigOmniVXDataBase):
"""
DockerWorkerConfigOmniV2Data
"""
config: DockerWorkerConfigV2 = Field(...)
config_orig: Optional[DockerWorkerConfigV2] = Field(None, alias="configOrig")
__properties = ["id", "version", "createdAt", "config", "configOrig"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = 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) -> DockerWorkerConfigOmniV2Data:
"""Create an instance of DockerWorkerConfigOmniV2Data 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={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of config_orig
if self.config_orig:
_dict['configOrig' if by_alias else 'config_orig'] = self.config_orig.to_dict(by_alias=by_alias)
return _dict

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

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

# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigOmniV2Data) in the input: " + str(obj))

_obj = DockerWorkerConfigOmniV2Data.parse_obj({
"id": obj.get("id"),
"version": obj.get("version"),
"created_at": obj.get("createdAt"),
"config": DockerWorkerConfigV2.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"config_orig": DockerWorkerConfigV2.from_dict(obj.get("configOrig")) if obj.get("configOrig") is not None else None
})
return _obj

Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# 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
from pydantic import Extra, BaseModel, Field
from lightly.openapi_generated.swagger_client.models.docker_worker_config_v2 import DockerWorkerConfigV2

class DockerWorkerConfigOmniV2DataAllOf(BaseModel):
"""
DockerWorkerConfigOmniV2DataAllOf
"""
config: DockerWorkerConfigV2 = Field(...)
config_orig: Optional[DockerWorkerConfigV2] = Field(None, alias="configOrig")
__properties = ["config", "configOrig"]

class Config:
"""Pydantic configuration"""
allow_population_by_field_name = True
validate_assignment = True
use_enum_values = True
extra = 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) -> DockerWorkerConfigOmniV2DataAllOf:
"""Create an instance of DockerWorkerConfigOmniV2DataAllOf 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={
},
exclude_none=True)
# override the default output from pydantic by calling `to_dict()` of config
if self.config:
_dict['config' if by_alias else 'config'] = self.config.to_dict(by_alias=by_alias)
# override the default output from pydantic by calling `to_dict()` of config_orig
if self.config_orig:
_dict['configOrig' if by_alias else 'config_orig'] = self.config_orig.to_dict(by_alias=by_alias)
return _dict

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

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

# raise errors for additional fields in the input
for _key in obj.keys():
if _key not in cls.__properties:
raise ValueError("Error due to additional fields (not defined in DockerWorkerConfigOmniV2DataAllOf) in the input: " + str(obj))

_obj = DockerWorkerConfigOmniV2DataAllOf.parse_obj({
"config": DockerWorkerConfigV2.from_dict(obj.get("config")) if obj.get("config") is not None else None,
"config_orig": DockerWorkerConfigV2.from_dict(obj.get("configOrig")) if obj.get("configOrig") is not None else None
})
return _obj

Loading

0 comments on commit 17e1038

Please sign in to comment.