From 8699ef0245b74510a529ee13dfc926123c2f6901 Mon Sep 17 00:00:00 2001 From: Evan Sims Date: Mon, 1 Apr 2024 19:37:05 -0500 Subject: [PATCH] feat(WIP): update generated SDK to latest --- .openapi-generator/FILES | 4 + README.md | 2 + docs/Condition.md | 1 + docs/ConditionMetadata.md | 12 ++ docs/Metadata.md | 2 + docs/RelationMetadata.md | 2 + docs/SourceInfo.md | 11 ++ openfga_sdk/__init__.py | 2 + openfga_sdk/models/__init__.py | 2 + openfga_sdk/models/condition.py | 33 +++++- openfga_sdk/models/condition_metadata.py | 145 +++++++++++++++++++++++ openfga_sdk/models/metadata.py | 72 ++++++++++- openfga_sdk/models/relation_metadata.py | 72 ++++++++++- openfga_sdk/models/source_info.py | 121 +++++++++++++++++++ 14 files changed, 470 insertions(+), 11 deletions(-) create mode 100644 docs/ConditionMetadata.md create mode 100644 docs/SourceInfo.md create mode 100644 openfga_sdk/models/condition_metadata.py create mode 100644 openfga_sdk/models/source_info.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 09f3529..86ea4be 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -24,6 +24,7 @@ docs/CheckRequestTupleKey.md docs/CheckResponse.md docs/Computed.md docs/Condition.md +docs/ConditionMetadata.md docs/ConditionParamTypeRef.md docs/ContextualTupleKeys.md docs/CreateStoreRequest.md @@ -58,6 +59,7 @@ docs/ReadResponse.md docs/RelationMetadata.md docs/RelationReference.md docs/RelationshipCondition.md +docs/SourceInfo.md docs/Status.md docs/Store.md docs/Tuple.md @@ -123,6 +125,7 @@ openfga_sdk/models/check_request_tuple_key.py openfga_sdk/models/check_response.py openfga_sdk/models/computed.py openfga_sdk/models/condition.py +openfga_sdk/models/condition_metadata.py openfga_sdk/models/condition_param_type_ref.py openfga_sdk/models/contextual_tuple_keys.py openfga_sdk/models/create_store_request.py @@ -156,6 +159,7 @@ openfga_sdk/models/read_response.py openfga_sdk/models/relation_metadata.py openfga_sdk/models/relation_reference.py openfga_sdk/models/relationship_condition.py +openfga_sdk/models/source_info.py openfga_sdk/models/status.py openfga_sdk/models/store.py openfga_sdk/models/tuple.py diff --git a/README.md b/README.md index bd81a9d..784bb4a 100644 --- a/README.md +++ b/README.md @@ -992,6 +992,7 @@ Class | Method | HTTP request | Description - [CheckResponse](https://github.com/openfga/python-sdk/blob/main/docs/CheckResponse.md) - [Computed](https://github.com/openfga/python-sdk/blob/main/docs/Computed.md) - [Condition](https://github.com/openfga/python-sdk/blob/main/docs/Condition.md) + - [ConditionMetadata](https://github.com/openfga/python-sdk/blob/main/docs/ConditionMetadata.md) - [ConditionParamTypeRef](https://github.com/openfga/python-sdk/blob/main/docs/ConditionParamTypeRef.md) - [ContextualTupleKeys](https://github.com/openfga/python-sdk/blob/main/docs/ContextualTupleKeys.md) - [CreateStoreRequest](https://github.com/openfga/python-sdk/blob/main/docs/CreateStoreRequest.md) @@ -1025,6 +1026,7 @@ Class | Method | HTTP request | Description - [RelationMetadata](https://github.com/openfga/python-sdk/blob/main/docs/RelationMetadata.md) - [RelationReference](https://github.com/openfga/python-sdk/blob/main/docs/RelationReference.md) - [RelationshipCondition](https://github.com/openfga/python-sdk/blob/main/docs/RelationshipCondition.md) + - [SourceInfo](https://github.com/openfga/python-sdk/blob/main/docs/SourceInfo.md) - [Status](https://github.com/openfga/python-sdk/blob/main/docs/Status.md) - [Store](https://github.com/openfga/python-sdk/blob/main/docs/Store.md) - [Tuple](https://github.com/openfga/python-sdk/blob/main/docs/Tuple.md) diff --git a/docs/Condition.md b/docs/Condition.md index a61db88..eba875b 100644 --- a/docs/Condition.md +++ b/docs/Condition.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **name** | **str** | | **expression** | **str** | A Google CEL expression, expressed as a string. | **parameters** | [**dict[str, ConditionParamTypeRef]**](ConditionParamTypeRef.md) | A map of parameter names to the parameter's defined type reference. | [optional] +**metadata** | [**ConditionMetadata**](ConditionMetadata.md) | | [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/docs/ConditionMetadata.md b/docs/ConditionMetadata.md new file mode 100644 index 0000000..d016a92 --- /dev/null +++ b/docs/ConditionMetadata.md @@ -0,0 +1,12 @@ +# ConditionMetadata + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**module** | **str** | | [optional] +**source_info** | [**SourceInfo**](SourceInfo.md) | | [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/docs/Metadata.md b/docs/Metadata.md index e6530dd..8d1f32c 100644 --- a/docs/Metadata.md +++ b/docs/Metadata.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **relations** | [**dict[str, RelationMetadata]**](RelationMetadata.md) | | [optional] +**module** | **str** | | [optional] +**source_info** | [**SourceInfo**](SourceInfo.md) | | [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/docs/RelationMetadata.md b/docs/RelationMetadata.md index 7956aad..2745a37 100644 --- a/docs/RelationMetadata.md +++ b/docs/RelationMetadata.md @@ -5,6 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **directly_related_user_types** | [**list[RelationReference]**](RelationReference.md) | | [optional] +**module** | **str** | | [optional] +**source_info** | [**SourceInfo**](SourceInfo.md) | | [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/docs/SourceInfo.md b/docs/SourceInfo.md new file mode 100644 index 0000000..e18c008 --- /dev/null +++ b/docs/SourceInfo.md @@ -0,0 +1,11 @@ +# SourceInfo + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | **str** | | [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/openfga_sdk/__init__.py b/openfga_sdk/__init__.py index 2312b05..36ba41f 100644 --- a/openfga_sdk/__init__.py +++ b/openfga_sdk/__init__.py @@ -35,6 +35,7 @@ from openfga_sdk.models.check_response import CheckResponse from openfga_sdk.models.computed import Computed from openfga_sdk.models.condition import Condition +from openfga_sdk.models.condition_metadata import ConditionMetadata from openfga_sdk.models.condition_param_type_ref import ConditionParamTypeRef from openfga_sdk.models.contextual_tuple_keys import ContextualTupleKeys from openfga_sdk.models.create_store_request import CreateStoreRequest @@ -76,6 +77,7 @@ from openfga_sdk.models.relation_metadata import RelationMetadata from openfga_sdk.models.relation_reference import RelationReference from openfga_sdk.models.relationship_condition import RelationshipCondition +from openfga_sdk.models.source_info import SourceInfo from openfga_sdk.models.status import Status from openfga_sdk.models.store import Store from openfga_sdk.models.tuple import Tuple diff --git a/openfga_sdk/models/__init__.py b/openfga_sdk/models/__init__.py index 15d47d4..a53f89f 100644 --- a/openfga_sdk/models/__init__.py +++ b/openfga_sdk/models/__init__.py @@ -20,6 +20,7 @@ from openfga_sdk.models.check_response import CheckResponse from openfga_sdk.models.computed import Computed from openfga_sdk.models.condition import Condition +from openfga_sdk.models.condition_metadata import ConditionMetadata from openfga_sdk.models.condition_param_type_ref import ConditionParamTypeRef from openfga_sdk.models.contextual_tuple_keys import ContextualTupleKeys from openfga_sdk.models.create_store_request import CreateStoreRequest @@ -61,6 +62,7 @@ from openfga_sdk.models.relation_metadata import RelationMetadata from openfga_sdk.models.relation_reference import RelationReference from openfga_sdk.models.relationship_condition import RelationshipCondition +from openfga_sdk.models.source_info import SourceInfo from openfga_sdk.models.status import Status from openfga_sdk.models.store import Store from openfga_sdk.models.tuple import Tuple diff --git a/openfga_sdk/models/condition.py b/openfga_sdk/models/condition.py index 076f469..6e8b579 100644 --- a/openfga_sdk/models/condition.py +++ b/openfga_sdk/models/condition.py @@ -37,16 +37,23 @@ class Condition: "name": "str", "expression": "str", "parameters": "dict[str, ConditionParamTypeRef]", + "metadata": "ConditionMetadata", } attribute_map = { "name": "name", "expression": "expression", "parameters": "parameters", + "metadata": "metadata", } def __init__( - self, name=None, expression=None, parameters=None, local_vars_configuration=None + self, + name=None, + expression=None, + parameters=None, + metadata=None, + local_vars_configuration=None, ): """Condition - a model defined in OpenAPI""" if local_vars_configuration is None: @@ -56,12 +63,15 @@ def __init__( self._name = None self._expression = None self._parameters = None + self._metadata = None self.discriminator = None self.name = name self.expression = expression if parameters is not None: self.parameters = parameters + if metadata is not None: + self.metadata = metadata @property def name(self): @@ -134,6 +144,27 @@ def parameters(self, parameters): self._parameters = parameters + @property + def metadata(self): + """Gets the metadata of this Condition. + + + :return: The metadata of this Condition. + :rtype: ConditionMetadata + """ + return self._metadata + + @metadata.setter + def metadata(self, metadata): + """Sets the metadata of this Condition. + + + :param metadata: The metadata of this Condition. + :type metadata: ConditionMetadata + """ + + self._metadata = metadata + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/openfga_sdk/models/condition_metadata.py b/openfga_sdk/models/condition_metadata.py new file mode 100644 index 0000000..c5ccfc3 --- /dev/null +++ b/openfga_sdk/models/condition_metadata.py @@ -0,0 +1,145 @@ +""" + Python SDK for OpenFGA + + API version: 0.1 + Website: https://openfga.dev + Documentation: https://openfga.dev/docs + Support: https://openfga.dev/community + License: [Apache-2.0](https://github.com/openfga/python-sdk/blob/main/LICENSE) + + NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. +""" + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint + +from openfga_sdk.configuration import Configuration + + +class ConditionMetadata: + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"module": "str", "source_info": "SourceInfo"} + + attribute_map = {"module": "module", "source_info": "source_info"} + + def __init__(self, module=None, source_info=None, local_vars_configuration=None): + """ConditionMetadata - a model defined in OpenAPI""" + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._module = None + self._source_info = None + self.discriminator = None + + if module is not None: + self.module = module + if source_info is not None: + self.source_info = source_info + + @property + def module(self): + """Gets the module of this ConditionMetadata. + + + :return: The module of this ConditionMetadata. + :rtype: str + """ + return self._module + + @module.setter + def module(self, module): + """Sets the module of this ConditionMetadata. + + + :param module: The module of this ConditionMetadata. + :type module: str + """ + + self._module = module + + @property + def source_info(self): + """Gets the source_info of this ConditionMetadata. + + + :return: The source_info of this ConditionMetadata. + :rtype: SourceInfo + """ + return self._source_info + + @source_info.setter + def source_info(self, source_info): + """Sets the source_info of this ConditionMetadata. + + + :param source_info: The source_info of this ConditionMetadata. + :type source_info: SourceInfo + """ + + self._source_info = source_info + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in self.openapi_types.items(): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict( + map(lambda item: (item[0], convert(item[1])), value.items()) + ) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ConditionMetadata): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, ConditionMetadata): + return True + + return self.to_dict() != other.to_dict() diff --git a/openfga_sdk/models/metadata.py b/openfga_sdk/models/metadata.py index 38ef47c..636ef59 100644 --- a/openfga_sdk/models/metadata.py +++ b/openfga_sdk/models/metadata.py @@ -33,21 +33,41 @@ class Metadata: attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"relations": "dict[str, RelationMetadata]"} - - attribute_map = {"relations": "relations"} - - def __init__(self, relations=None, local_vars_configuration=None): + openapi_types = { + "relations": "dict[str, RelationMetadata]", + "module": "str", + "source_info": "SourceInfo", + } + + attribute_map = { + "relations": "relations", + "module": "module", + "source_info": "source_info", + } + + def __init__( + self, + relations=None, + module=None, + source_info=None, + local_vars_configuration=None, + ): """Metadata - a model defined in OpenAPI""" if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration self._relations = None + self._module = None + self._source_info = None self.discriminator = None if relations is not None: self.relations = relations + if module is not None: + self.module = module + if source_info is not None: + self.source_info = source_info @property def relations(self): @@ -70,6 +90,48 @@ def relations(self, relations): self._relations = relations + @property + def module(self): + """Gets the module of this Metadata. + + + :return: The module of this Metadata. + :rtype: str + """ + return self._module + + @module.setter + def module(self, module): + """Sets the module of this Metadata. + + + :param module: The module of this Metadata. + :type module: str + """ + + self._module = module + + @property + def source_info(self): + """Gets the source_info of this Metadata. + + + :return: The source_info of this Metadata. + :rtype: SourceInfo + """ + return self._source_info + + @source_info.setter + def source_info(self, source_info): + """Sets the source_info of this Metadata. + + + :param source_info: The source_info of this Metadata. + :type source_info: SourceInfo + """ + + self._source_info = source_info + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/openfga_sdk/models/relation_metadata.py b/openfga_sdk/models/relation_metadata.py index ee9a63a..4af57be 100644 --- a/openfga_sdk/models/relation_metadata.py +++ b/openfga_sdk/models/relation_metadata.py @@ -33,21 +33,41 @@ class RelationMetadata: attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {"directly_related_user_types": "list[RelationReference]"} - - attribute_map = {"directly_related_user_types": "directly_related_user_types"} - - def __init__(self, directly_related_user_types=None, local_vars_configuration=None): + openapi_types = { + "directly_related_user_types": "list[RelationReference]", + "module": "str", + "source_info": "SourceInfo", + } + + attribute_map = { + "directly_related_user_types": "directly_related_user_types", + "module": "module", + "source_info": "source_info", + } + + def __init__( + self, + directly_related_user_types=None, + module=None, + source_info=None, + local_vars_configuration=None, + ): """RelationMetadata - a model defined in OpenAPI""" if local_vars_configuration is None: local_vars_configuration = Configuration.get_default_copy() self.local_vars_configuration = local_vars_configuration self._directly_related_user_types = None + self._module = None + self._source_info = None self.discriminator = None if directly_related_user_types is not None: self.directly_related_user_types = directly_related_user_types + if module is not None: + self.module = module + if source_info is not None: + self.source_info = source_info @property def directly_related_user_types(self): @@ -70,6 +90,48 @@ def directly_related_user_types(self, directly_related_user_types): self._directly_related_user_types = directly_related_user_types + @property + def module(self): + """Gets the module of this RelationMetadata. + + + :return: The module of this RelationMetadata. + :rtype: str + """ + return self._module + + @module.setter + def module(self, module): + """Sets the module of this RelationMetadata. + + + :param module: The module of this RelationMetadata. + :type module: str + """ + + self._module = module + + @property + def source_info(self): + """Gets the source_info of this RelationMetadata. + + + :return: The source_info of this RelationMetadata. + :rtype: SourceInfo + """ + return self._source_info + + @source_info.setter + def source_info(self, source_info): + """Sets the source_info of this RelationMetadata. + + + :param source_info: The source_info of this RelationMetadata. + :type source_info: SourceInfo + """ + + self._source_info = source_info + def to_dict(self, serialize=False): """Returns the model properties as a dict""" result = {} diff --git a/openfga_sdk/models/source_info.py b/openfga_sdk/models/source_info.py new file mode 100644 index 0000000..c50e314 --- /dev/null +++ b/openfga_sdk/models/source_info.py @@ -0,0 +1,121 @@ +""" + Python SDK for OpenFGA + + API version: 0.1 + Website: https://openfga.dev + Documentation: https://openfga.dev/docs + Support: https://openfga.dev/community + License: [Apache-2.0](https://github.com/openfga/python-sdk/blob/main/LICENSE) + + NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech). DO NOT EDIT. +""" + +try: + from inspect import getfullargspec +except ImportError: + from inspect import getargspec as getfullargspec +import pprint + +from openfga_sdk.configuration import Configuration + + +class SourceInfo: + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {"file": "str"} + + attribute_map = {"file": "file"} + + def __init__(self, file=None, local_vars_configuration=None): + """SourceInfo - a model defined in OpenAPI""" + if local_vars_configuration is None: + local_vars_configuration = Configuration.get_default_copy() + self.local_vars_configuration = local_vars_configuration + + self._file = None + self.discriminator = None + + if file is not None: + self.file = file + + @property + def file(self): + """Gets the file of this SourceInfo. + + + :return: The file of this SourceInfo. + :rtype: str + """ + return self._file + + @file.setter + def file(self, file): + """Sets the file of this SourceInfo. + + + :param file: The file of this SourceInfo. + :type file: str + """ + + self._file = file + + def to_dict(self, serialize=False): + """Returns the model properties as a dict""" + result = {} + + def convert(x): + if hasattr(x, "to_dict"): + args = getfullargspec(x.to_dict).args + if len(args) == 1: + return x.to_dict() + else: + return x.to_dict(serialize) + else: + return x + + for attr, _ in self.openapi_types.items(): + value = getattr(self, attr) + attr = self.attribute_map.get(attr, attr) if serialize else attr + if isinstance(value, list): + result[attr] = list(map(lambda x: convert(x), value)) + elif isinstance(value, dict): + result[attr] = dict( + map(lambda item: (item[0], convert(item[1])), value.items()) + ) + else: + result[attr] = convert(value) + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, SourceInfo): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, SourceInfo): + return True + + return self.to_dict() != other.to_dict()