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

1# coding: utf-8 

2 

3""" 

4 GroMEt Metadata spec 

5 

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 

7 

8 OpenAPI spec version: 0.1.8 

9 Contact: claytonm@arizona.edu 

10 Generated by: https://github.com/swagger-api/swagger-codegen.git 

11""" 

12 

13import pprint 

14import re # noqa: F401 

15 

16import six 

17 

18class TextualDocumentReference(object): 

19 """NOTE: This class is auto generated by the swagger code generator program. 

20 

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 } 

40 

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 } 

51 

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 

79 

80 @property 

81 def gromet_type(self): 

82 """Gets the gromet_type of this TextualDocumentReference. # noqa: E501 

83 

84 

85 :return: The gromet_type of this TextualDocumentReference. # noqa: E501 

86 :rtype: str 

87 """ 

88 return self._gromet_type 

89 

90 @gromet_type.setter 

91 def gromet_type(self, gromet_type): 

92 """Sets the gromet_type of this TextualDocumentReference. 

93 

94 

95 :param gromet_type: The gromet_type of this TextualDocumentReference. # noqa: E501 

96 :type: str 

97 """ 

98 

99 self._gromet_type = gromet_type 

100 

101 @property 

102 def uid(self): 

103 """Gets the uid of this TextualDocumentReference. # noqa: E501 

104 

105 Unique identifier of the DocumentReference # noqa: E501 

106 

107 :return: The uid of this TextualDocumentReference. # noqa: E501 

108 :rtype: str 

109 """ 

110 return self._uid 

111 

112 @uid.setter 

113 def uid(self, uid): 

114 """Sets the uid of this TextualDocumentReference. 

115 

116 Unique identifier of the DocumentReference # noqa: E501 

117 

118 :param uid: The uid of this TextualDocumentReference. # noqa: E501 

119 :type: str 

120 """ 

121 

122 self._uid = uid 

123 

124 @property 

125 def global_reference_id(self): 

126 """Gets the global_reference_id of this TextualDocumentReference. # noqa: E501 

127 

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 

129 

130 :return: The global_reference_id of this TextualDocumentReference. # noqa: E501 

131 :rtype: str 

132 """ 

133 return self._global_reference_id 

134 

135 @global_reference_id.setter 

136 def global_reference_id(self, global_reference_id): 

137 """Sets the global_reference_id of this TextualDocumentReference. 

138 

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 

140 

141 :param global_reference_id: The global_reference_id of this TextualDocumentReference. # noqa: E501 

142 :type: str 

143 """ 

144 

145 self._global_reference_id = global_reference_id 

146 

147 @property 

148 def cosmos_id(self): 

149 """Gets the cosmos_id of this TextualDocumentReference. # noqa: E501 

150 

151 ID of COSMOS component used to process document. # noqa: E501 

152 

153 :return: The cosmos_id of this TextualDocumentReference. # noqa: E501 

154 :rtype: str 

155 """ 

156 return self._cosmos_id 

157 

158 @cosmos_id.setter 

159 def cosmos_id(self, cosmos_id): 

160 """Sets the cosmos_id of this TextualDocumentReference. 

161 

162 ID of COSMOS component used to process document. # noqa: E501 

163 

164 :param cosmos_id: The cosmos_id of this TextualDocumentReference. # noqa: E501 

165 :type: str 

166 """ 

167 

168 self._cosmos_id = cosmos_id 

169 

170 @property 

171 def cosmos_version_number(self): 

172 """Gets the cosmos_version_number of this TextualDocumentReference. # noqa: E501 

173 

174 Version number of COSMOS component. # noqa: E501 

175 

176 :return: The cosmos_version_number of this TextualDocumentReference. # noqa: E501 

177 :rtype: str 

178 """ 

179 return self._cosmos_version_number 

180 

181 @cosmos_version_number.setter 

182 def cosmos_version_number(self, cosmos_version_number): 

183 """Sets the cosmos_version_number of this TextualDocumentReference. 

184 

185 Version number of COSMOS component. # noqa: E501 

186 

187 :param cosmos_version_number: The cosmos_version_number of this TextualDocumentReference. # noqa: E501 

188 :type: str 

189 """ 

190 

191 self._cosmos_version_number = cosmos_version_number 

192 

193 @property 

194 def skema_id(self): 

195 """Gets the skema_id of this TextualDocumentReference. # noqa: E501 

196 

197 ID of SKEMA component used to process document. # noqa: E501 

198 

199 :return: The skema_id of this TextualDocumentReference. # noqa: E501 

200 :rtype: str 

201 """ 

202 return self._skema_id 

203 

204 @skema_id.setter 

205 def skema_id(self, skema_id): 

206 """Sets the skema_id of this TextualDocumentReference. 

207 

208 ID of SKEMA component used to process document. # noqa: E501 

209 

210 :param skema_id: The skema_id of this TextualDocumentReference. # noqa: E501 

211 :type: str 

212 """ 

213 

214 self._skema_id = skema_id 

215 

216 @property 

217 def skema_version_number(self): 

218 """Gets the skema_version_number of this TextualDocumentReference. # noqa: E501 

219 

220 Version number of SKEMA component. # noqa: E501 

221 

222 :return: The skema_version_number of this TextualDocumentReference. # noqa: E501 

223 :rtype: str 

224 """ 

225 return self._skema_version_number 

226 

227 @skema_version_number.setter 

228 def skema_version_number(self, skema_version_number): 

229 """Sets the skema_version_number of this TextualDocumentReference. 

230 

231 Version number of SKEMA component. # noqa: E501 

232 

233 :param skema_version_number: The skema_version_number of this TextualDocumentReference. # noqa: E501 

234 :type: str 

235 """ 

236 

237 self._skema_version_number = skema_version_number 

238 

239 @property 

240 def bibjson(self): 

241 """Gets the bibjson of this TextualDocumentReference. # noqa: E501 

242 

243 

244 :return: The bibjson of this TextualDocumentReference. # noqa: E501 

245 :rtype: Bibjson 

246 """ 

247 return self._bibjson 

248 

249 @bibjson.setter 

250 def bibjson(self, bibjson): 

251 """Sets the bibjson of this TextualDocumentReference. 

252 

253 

254 :param bibjson: The bibjson of this TextualDocumentReference. # noqa: E501 

255 :type: Bibjson 

256 """ 

257 

258 self._bibjson = bibjson 

259 

260 def to_dict(self): 

261 """Returns the model properties as a dict""" 

262 result = {} 

263 

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 

284 

285 return result 

286 

287 def to_str(self): 

288 """Returns the string representation of the model""" 

289 return pprint.pformat(self.to_dict()) 

290 

291 def __repr__(self): 

292 """For `print` and `pprint`""" 

293 return self.to_str() 

294 

295 def __eq__(self, other): 

296 """Returns true if both objects are equal""" 

297 if not isinstance(other, TextualDocumentReference): 

298 return False 

299 

300 return self.__dict__ == other.__dict__ 

301 

302 def __ne__(self, other): 

303 """Returns true if both objects are not equal""" 

304 return not self == other