Coverage for skema/gromet/metadata/textual_document_reference.py: 42%
106 statements
« prev ^ index » next coverage.py v7.5.0, created at 2024-04-30 17:15 +0000
« prev ^ index » next coverage.py v7.5.0, created at 2024-04-30 17:15 +0000
1# coding: utf-8
3"""
4 GroMEt Metadata spec
6 Grounded Model Exchange (GroMEt) Metadata schema specification __Using Swagger to Generate Class Structure__ To automatically generate Python or Java models corresponding to this document, you can use [swagger-codegen](https://swagger.io/tools/swagger-codegen/). We can use this to generate client code based off of this spec that will also generate the class structure. 1. Install via the method described for your operating system [here](https://github.com/swagger-api/swagger-codegen#Prerequisites). Make sure to install a version after 3.0 that will support openapi 3. 2. Run swagger-codegen with the options in the example below. The URL references where the yaml for this documentation is stored on github. Make sure to replace CURRENT_VERSION with the correct version. (The current version is `0.1.4`.) To generate Java classes rather, change the `-l python` to `-l java`. Change the value to the `-o` option to the desired output location. ``` swagger-codegen generate -l python -o ./client -i https://raw.githubusercontent.com/ml4ai/automates-v2/master/docs/source/gromet_metadata_v{CURRENT_VERSION}.yaml ``` 3. Once it executes, the client code will be generated at your specified location. For python, the classes will be located in `$OUTPUT_PATH/swagger_client/models/`. For java, they will be located in `$OUTPUT_PATH/src/main/java/io/swagger/client/model/` If generating GroMEt Metadata schema data model classes in SKEMA (AutoMATES), then after generating the above, follow the instructions here: ``` <automates>/automates/model_assembly/gromet/metadata/README.md ``` # noqa: E501
8 OpenAPI spec version: 0.1.8
9 Contact: claytonm@arizona.edu
10 Generated by: https://github.com/swagger-api/swagger-codegen.git
11"""
13import pprint
14import re # noqa: F401
16import six
18class TextualDocumentReference(object):
19 """NOTE: This class is auto generated by the swagger code generator program.
21 Do not edit the class manually.
22 """
23 """
24 Attributes:
25 swagger_types (dict): The key is attribute name
26 and the value is attribute type.
27 attribute_map (dict): The key is attribute name
28 and the value is json key in definition.
29 """
30 swagger_types = {
31 'gromet_type': 'str',
32 'uid': 'str',
33 'global_reference_id': 'str',
34 'cosmos_id': 'str',
35 'cosmos_version_number': 'str',
36 'skema_id': 'str',
37 'skema_version_number': 'str',
38 'bibjson': 'Bibjson'
39 }
41 attribute_map = {
42 'gromet_type': 'gromet_type',
43 'uid': 'uid',
44 'global_reference_id': 'global_reference_id',
45 'cosmos_id': 'cosmos_id',
46 'cosmos_version_number': 'cosmos_version_number',
47 'skema_id': 'skema_id',
48 'skema_version_number': 'skema_version_number',
49 'bibjson': 'bibjson'
50 }
52 def __init__(self, gromet_type='TextualDocumentReference', uid=None, global_reference_id=None, cosmos_id=None, cosmos_version_number=None, skema_id=None, skema_version_number=None, bibjson=None): # noqa: E501
53 """TextualDocumentReference - a model defined in Swagger""" # noqa: E501
54 self._gromet_type = None
55 self._uid = None
56 self._global_reference_id = None
57 self._cosmos_id = None
58 self._cosmos_version_number = None
59 self._skema_id = None
60 self._skema_version_number = None
61 self._bibjson = None
62 self.discriminator = None
63 if gromet_type is not None:
64 self.gromet_type = gromet_type
65 if uid is not None:
66 self.uid = uid
67 if global_reference_id is not None:
68 self.global_reference_id = global_reference_id
69 if cosmos_id is not None:
70 self.cosmos_id = cosmos_id
71 if cosmos_version_number is not None:
72 self.cosmos_version_number = cosmos_version_number
73 if skema_id is not None:
74 self.skema_id = skema_id
75 if skema_version_number is not None:
76 self.skema_version_number = skema_version_number
77 if bibjson is not None:
78 self.bibjson = bibjson
80 @property
81 def gromet_type(self):
82 """Gets the gromet_type of this TextualDocumentReference. # noqa: E501
85 :return: The gromet_type of this TextualDocumentReference. # noqa: E501
86 :rtype: str
87 """
88 return self._gromet_type
90 @gromet_type.setter
91 def gromet_type(self, gromet_type):
92 """Sets the gromet_type of this TextualDocumentReference.
95 :param gromet_type: The gromet_type of this TextualDocumentReference. # noqa: E501
96 :type: str
97 """
99 self._gromet_type = gromet_type
101 @property
102 def uid(self):
103 """Gets the uid of this TextualDocumentReference. # noqa: E501
105 Unique identifier of the DocumentReference # noqa: E501
107 :return: The uid of this TextualDocumentReference. # noqa: E501
108 :rtype: str
109 """
110 return self._uid
112 @uid.setter
113 def uid(self, uid):
114 """Sets the uid of this TextualDocumentReference.
116 Unique identifier of the DocumentReference # noqa: E501
118 :param uid: The uid of this TextualDocumentReference. # noqa: E501
119 :type: str
120 """
122 self._uid = uid
124 @property
125 def global_reference_id(self):
126 """Gets the global_reference_id of this TextualDocumentReference. # noqa: E501
128 Identifier of source document.<br> Rank preference of identifier type:<br> (1) DOI (digital object identifier) recognized by COSMOS<br> (2) PMID (Pubmed ID) or other DOI<br> (3) aske_id (ASKE unique identifier) # noqa: E501
130 :return: The global_reference_id of this TextualDocumentReference. # noqa: E501
131 :rtype: str
132 """
133 return self._global_reference_id
135 @global_reference_id.setter
136 def global_reference_id(self, global_reference_id):
137 """Sets the global_reference_id of this TextualDocumentReference.
139 Identifier of source document.<br> Rank preference of identifier type:<br> (1) DOI (digital object identifier) recognized by COSMOS<br> (2) PMID (Pubmed ID) or other DOI<br> (3) aske_id (ASKE unique identifier) # noqa: E501
141 :param global_reference_id: The global_reference_id of this TextualDocumentReference. # noqa: E501
142 :type: str
143 """
145 self._global_reference_id = global_reference_id
147 @property
148 def cosmos_id(self):
149 """Gets the cosmos_id of this TextualDocumentReference. # noqa: E501
151 ID of COSMOS component used to process document. # noqa: E501
153 :return: The cosmos_id of this TextualDocumentReference. # noqa: E501
154 :rtype: str
155 """
156 return self._cosmos_id
158 @cosmos_id.setter
159 def cosmos_id(self, cosmos_id):
160 """Sets the cosmos_id of this TextualDocumentReference.
162 ID of COSMOS component used to process document. # noqa: E501
164 :param cosmos_id: The cosmos_id of this TextualDocumentReference. # noqa: E501
165 :type: str
166 """
168 self._cosmos_id = cosmos_id
170 @property
171 def cosmos_version_number(self):
172 """Gets the cosmos_version_number of this TextualDocumentReference. # noqa: E501
174 Version number of COSMOS component. # noqa: E501
176 :return: The cosmos_version_number of this TextualDocumentReference. # noqa: E501
177 :rtype: str
178 """
179 return self._cosmos_version_number
181 @cosmos_version_number.setter
182 def cosmos_version_number(self, cosmos_version_number):
183 """Sets the cosmos_version_number of this TextualDocumentReference.
185 Version number of COSMOS component. # noqa: E501
187 :param cosmos_version_number: The cosmos_version_number of this TextualDocumentReference. # noqa: E501
188 :type: str
189 """
191 self._cosmos_version_number = cosmos_version_number
193 @property
194 def skema_id(self):
195 """Gets the skema_id of this TextualDocumentReference. # noqa: E501
197 ID of SKEMA component used to process document. # noqa: E501
199 :return: The skema_id of this TextualDocumentReference. # noqa: E501
200 :rtype: str
201 """
202 return self._skema_id
204 @skema_id.setter
205 def skema_id(self, skema_id):
206 """Sets the skema_id of this TextualDocumentReference.
208 ID of SKEMA component used to process document. # noqa: E501
210 :param skema_id: The skema_id of this TextualDocumentReference. # noqa: E501
211 :type: str
212 """
214 self._skema_id = skema_id
216 @property
217 def skema_version_number(self):
218 """Gets the skema_version_number of this TextualDocumentReference. # noqa: E501
220 Version number of SKEMA component. # noqa: E501
222 :return: The skema_version_number of this TextualDocumentReference. # noqa: E501
223 :rtype: str
224 """
225 return self._skema_version_number
227 @skema_version_number.setter
228 def skema_version_number(self, skema_version_number):
229 """Sets the skema_version_number of this TextualDocumentReference.
231 Version number of SKEMA component. # noqa: E501
233 :param skema_version_number: The skema_version_number of this TextualDocumentReference. # noqa: E501
234 :type: str
235 """
237 self._skema_version_number = skema_version_number
239 @property
240 def bibjson(self):
241 """Gets the bibjson of this TextualDocumentReference. # noqa: E501
244 :return: The bibjson of this TextualDocumentReference. # noqa: E501
245 :rtype: Bibjson
246 """
247 return self._bibjson
249 @bibjson.setter
250 def bibjson(self, bibjson):
251 """Sets the bibjson of this TextualDocumentReference.
254 :param bibjson: The bibjson of this TextualDocumentReference. # noqa: E501
255 :type: Bibjson
256 """
258 self._bibjson = bibjson
260 def to_dict(self):
261 """Returns the model properties as a dict"""
262 result = {}
264 for attr, _ in six.iteritems(self.swagger_types):
265 value = getattr(self, attr)
266 if isinstance(value, list):
267 result[attr] = list(map(
268 lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
269 value
270 ))
271 elif hasattr(value, "to_dict"):
272 result[attr] = value.to_dict()
273 elif isinstance(value, dict):
274 result[attr] = dict(map(
275 lambda item: (item[0], item[1].to_dict())
276 if hasattr(item[1], "to_dict") else item,
277 value.items()
278 ))
279 else:
280 result[attr] = value
281 if issubclass(TextualDocumentReference, dict):
282 for key, value in self.items():
283 result[key] = value
285 return result
287 def to_str(self):
288 """Returns the string representation of the model"""
289 return pprint.pformat(self.to_dict())
291 def __repr__(self):
292 """For `print` and `pprint`"""
293 return self.to_str()
295 def __eq__(self, other):
296 """Returns true if both objects are equal"""
297 if not isinstance(other, TextualDocumentReference):
298 return False
300 return self.__dict__ == other.__dict__
302 def __ne__(self, other):
303 """Returns true if both objects are not equal"""
304 return not self == other