Connections
cognite.pygen._core.models.fields.connections
This module contains the fields that contain a connection to another data class. These fields are references to another object in the data model.
BaseConnectionField
dataclass
Bases: Field
, ABC
Source code in cognite/pygen/_core/models/fields/connections.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 |
|
edge_type_str: str
property
Returns the edge type as a string.
is_connection: bool
property
Returns True if the connection is a connection.
is_direct_relation: bool
property
Returns True if the connection is a direct relation.
is_direct_relation_no_source: bool
property
Returns True if the connection is a direct relation without a source.
is_edge: bool
property
Returns True if the connection is an edge.
is_edge_with_properties: bool
property
Returns True if the connection is an edge with properties.
is_edge_without_properties: bool
property
Returns True if the connection is an edge without properties.
is_one_to_many: bool
property
Returns True if the connection is a one-to-many connection.
is_one_to_one: bool
property
Returns True if the connection is a one-to-one connection.
is_reverse_direct_relation: bool
property
Returns True if the connection is a reverse direct relation.
is_write_field: bool
property
Returns True if the connection is writable.
through_str: str
property
Returns the through property as a string.
as_graphql_type_hint()
Return the type hint for the field in the GraphQL data class.
Source code in cognite/pygen/_core/models/fields/connections.py
as_read_graphql()
Return the code to convert the field from the GraphQL to the read data class.
as_read_type_hint()
Return the type hint for the field in the read data class.
Source code in cognite/pygen/_core/models/fields/connections.py
as_write()
Return the code to convert the field from read to write data class.
Source code in cognite/pygen/_core/models/fields/connections.py
as_write_graphql()
Return the code to convert the field from the write data class to the GraphQL.
as_write_type_hint()
Return the type hint for the field in the write data class.
Source code in cognite/pygen/_core/models/fields/connections.py
load(base, prop, variable, node_class_by_view_id, edge_class_by_view_id, has_default_instance_space, view_id, direct_relations_by_view_id)
classmethod
Load a connection field from a property
Source code in cognite/pygen/_core/models/fields/connections.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
|
EdgeClass
dataclass
This represents a specific edge type linking two data classes.
Source code in cognite/pygen/_core/models/fields/connections.py
EndNodeField
dataclass
Bases: Field
This represents a one-to-one edge where the end class can be one of multiple data classes. This is used for the end_node field in edge data classes, where the end_node can be one of multiple data classes.
This is a special class that is not instantiated from a property, but is created in the edge data class.