@@ -3008,9 +3008,8 @@ def insert(
3008
3008
self ,
3009
3009
vertex : Json ,
3010
3010
sync : Optional [bool ] = None ,
3011
- silent : bool = False ,
3012
3011
return_new : bool = False ,
3013
- ) -> Result [Union [ bool , Json ] ]:
3012
+ ) -> Result [Json ]:
3014
3013
"""Insert a new vertex document.
3015
3014
3016
3015
:param vertex: New vertex document to insert. If it has "_key" or "_id"
@@ -3019,20 +3018,16 @@ def insert(
3019
3018
:type vertex: dict
3020
3019
:param sync: Block until operation is synchronized to disk.
3021
3020
:type sync: bool | None
3022
- :param silent: If set to True, no document metadata is returned. This
3023
- can be used to save resources.
3024
- :type silent: bool
3025
3021
:param return_new: Include body of the new document in the returned
3026
3022
metadata. Ignored if parameter **silent** is set to True.
3027
3023
:type return_new: bool
3028
- :return: Document metadata (e.g. document key, revision), or True if
3029
- parameter **silent** was set to True.
3030
- :rtype: bool | dict
3024
+ :return: Document metadata (e.g. document key, revision).
3025
+ :rtype: dict
3031
3026
:raise arango.exceptions.DocumentInsertError: If insert fails.
3032
3027
"""
3033
3028
vertex = self ._ensure_key_from_id (vertex )
3034
3029
3035
- params : Params = {"silent" : silent , " returnNew" : return_new }
3030
+ params : Params = {"returnNew" : return_new }
3036
3031
if sync is not None :
3037
3032
params ["waitForSync" ] = sync
3038
3033
@@ -3044,11 +3039,9 @@ def insert(
3044
3039
write = self .name ,
3045
3040
)
3046
3041
3047
- def response_handler (resp : Response ) -> Union [ bool , Json ] :
3042
+ def response_handler (resp : Response ) -> Json :
3048
3043
if not resp .is_success :
3049
3044
raise DocumentInsertError (resp , request )
3050
- if silent :
3051
- return True
3052
3045
return format_vertex (resp .body )
3053
3046
3054
3047
return self ._execute (request , response_handler )
@@ -3059,10 +3052,9 @@ def update(
3059
3052
check_rev : bool = True ,
3060
3053
keep_none : bool = True ,
3061
3054
sync : Optional [bool ] = None ,
3062
- silent : bool = False ,
3063
3055
return_old : bool = False ,
3064
3056
return_new : bool = False ,
3065
- ) -> Result [Union [ bool , Json ] ]:
3057
+ ) -> Result [Json ]:
3066
3058
"""Update a vertex document.
3067
3059
3068
3060
:param vertex: Partial or full vertex document with updated values. It
@@ -3076,18 +3068,14 @@ def update(
3076
3068
:type keep_none: bool | None
3077
3069
:param sync: Block until operation is synchronized to disk.
3078
3070
:type sync: bool | None
3079
- :param silent: If set to True, no document metadata is returned. This
3080
- can be used to save resources.
3081
- :type silent: bool
3082
3071
:param return_old: Include body of the old document in the returned
3083
3072
metadata. Ignored if parameter **silent** is set to True.
3084
3073
:type return_old: bool
3085
3074
:param return_new: Include body of the new document in the returned
3086
3075
metadata. Ignored if parameter **silent** is set to True.
3087
3076
:type return_new: bool
3088
- :return: Document metadata (e.g. document key, revision) or True if
3089
- parameter **silent** was set to True.
3090
- :rtype: bool | dict
3077
+ :return: Document metadata (e.g. document key, revision).
3078
+ :rtype: dict
3091
3079
:raise arango.exceptions.DocumentUpdateError: If update fails.
3092
3080
:raise arango.exceptions.DocumentRevisionError: If revisions mismatch.
3093
3081
"""
@@ -3096,7 +3084,6 @@ def update(
3096
3084
params : Params = {
3097
3085
"keepNull" : keep_none ,
3098
3086
"overwrite" : not check_rev ,
3099
- "silent" : silent ,
3100
3087
"returnNew" : return_new ,
3101
3088
"returnOld" : return_old ,
3102
3089
}
@@ -3112,13 +3099,11 @@ def update(
3112
3099
write = self .name ,
3113
3100
)
3114
3101
3115
- def response_handler (resp : Response ) -> Union [ bool , Json ] :
3102
+ def response_handler (resp : Response ) -> Json :
3116
3103
if resp .status_code == 412 : # pragma: no cover
3117
3104
raise DocumentRevisionError (resp , request )
3118
3105
elif not resp .is_success :
3119
3106
raise DocumentUpdateError (resp , request )
3120
- if silent is True :
3121
- return True
3122
3107
return format_vertex (resp .body )
3123
3108
3124
3109
return self ._execute (request , response_handler )
@@ -3128,10 +3113,9 @@ def replace(
3128
3113
vertex : Json ,
3129
3114
check_rev : bool = True ,
3130
3115
sync : Optional [bool ] = None ,
3131
- silent : bool = False ,
3132
3116
return_old : bool = False ,
3133
3117
return_new : bool = False ,
3134
- ) -> Result [Union [ bool , Json ] ]:
3118
+ ) -> Result [Json ]:
3135
3119
"""Replace a vertex document.
3136
3120
3137
3121
:param vertex: New vertex document to replace the old one with. It must
@@ -3142,25 +3126,20 @@ def replace(
3142
3126
:type check_rev: bool
3143
3127
:param sync: Block until operation is synchronized to disk.
3144
3128
:type sync: bool | None
3145
- :param silent: If set to True, no document metadata is returned. This
3146
- can be used to save resources.
3147
- :type silent: bool
3148
3129
:param return_old: Include body of the old document in the returned
3149
3130
metadata. Ignored if parameter **silent** is set to True.
3150
3131
:type return_old: bool
3151
3132
:param return_new: Include body of the new document in the returned
3152
3133
metadata. Ignored if parameter **silent** is set to True.
3153
3134
:type return_new: bool
3154
- :return: Document metadata (e.g. document key, revision) or True if
3155
- parameter **silent** was set to True.
3156
- :rtype: bool | dict
3135
+ :return: Document metadata (e.g. document key, revision).
3136
+ :rtype: dict
3157
3137
:raise arango.exceptions.DocumentReplaceError: If replace fails.
3158
3138
:raise arango.exceptions.DocumentRevisionError: If revisions mismatch.
3159
3139
"""
3160
3140
vertex_id , headers = self ._prep_from_body (vertex , check_rev )
3161
3141
3162
3142
params : Params = {
3163
- "silent" : silent ,
3164
3143
"returnNew" : return_new ,
3165
3144
"returnOld" : return_old ,
3166
3145
}
@@ -3176,13 +3155,11 @@ def replace(
3176
3155
write = self .name ,
3177
3156
)
3178
3157
3179
- def response_handler (resp : Response ) -> Union [ bool , Json ] :
3158
+ def response_handler (resp : Response ) -> Json :
3180
3159
if resp .status_code == 412 : # pragma: no cover
3181
3160
raise DocumentRevisionError (resp , request )
3182
3161
elif not resp .is_success :
3183
3162
raise DocumentReplaceError (resp , request )
3184
- if silent is True :
3185
- return True
3186
3163
return format_vertex (resp .body )
3187
3164
3188
3165
return self ._execute (request , response_handler )
@@ -3326,9 +3303,8 @@ def insert(
3326
3303
self ,
3327
3304
edge : Json ,
3328
3305
sync : Optional [bool ] = None ,
3329
- silent : bool = False ,
3330
3306
return_new : bool = False ,
3331
- ) -> Result [Union [ bool , Json ] ]:
3307
+ ) -> Result [Json ]:
3332
3308
"""Insert a new edge document.
3333
3309
3334
3310
:param edge: New edge document to insert. It must contain "_from" and
@@ -3338,20 +3314,16 @@ def insert(
3338
3314
:type edge: dict
3339
3315
:param sync: Block until operation is synchronized to disk.
3340
3316
:type sync: bool | None
3341
- :param silent: If set to True, no document metadata is returned. This
3342
- can be used to save resources.
3343
- :type silent: bool
3344
3317
:param return_new: Include body of the new document in the returned
3345
3318
metadata. Ignored if parameter **silent** is set to True.
3346
3319
:type return_new: bool
3347
- :return: Document metadata (e.g. document key, revision) or True if
3348
- parameter **silent** was set to True.
3349
- :rtype: bool | dict
3320
+ :return: Document metadata (e.g. document key, revision).
3321
+ :rtype: dict
3350
3322
:raise arango.exceptions.DocumentInsertError: If insert fails.
3351
3323
"""
3352
3324
edge = self ._ensure_key_from_id (edge )
3353
3325
3354
- params : Params = {"silent" : silent , " returnNew" : return_new }
3326
+ params : Params = {"returnNew" : return_new }
3355
3327
if sync is not None :
3356
3328
params ["waitForSync" ] = sync
3357
3329
@@ -3363,11 +3335,9 @@ def insert(
3363
3335
write = self .name ,
3364
3336
)
3365
3337
3366
- def response_handler (resp : Response ) -> Union [ bool , Json ] :
3338
+ def response_handler (resp : Response ) -> Json :
3367
3339
if not resp .is_success :
3368
3340
raise DocumentInsertError (resp , request )
3369
- if silent :
3370
- return True
3371
3341
return format_edge (resp .body )
3372
3342
3373
3343
return self ._execute (request , response_handler )
@@ -3378,10 +3348,9 @@ def update(
3378
3348
check_rev : bool = True ,
3379
3349
keep_none : bool = True ,
3380
3350
sync : Optional [bool ] = None ,
3381
- silent : bool = False ,
3382
3351
return_old : bool = False ,
3383
3352
return_new : bool = False ,
3384
- ) -> Result [Union [ bool , Json ] ]:
3353
+ ) -> Result [Json ]:
3385
3354
"""Update an edge document.
3386
3355
3387
3356
:param edge: Partial or full edge document with updated values. It must
@@ -3395,18 +3364,14 @@ def update(
3395
3364
:type keep_none: bool | None
3396
3365
:param sync: Block until operation is synchronized to disk.
3397
3366
:type sync: bool | None
3398
- :param silent: If set to True, no document metadata is returned. This
3399
- can be used to save resources.
3400
- :type silent: bool
3401
3367
:param return_old: Include body of the old document in the returned
3402
3368
metadata. Ignored if parameter **silent** is set to True.
3403
3369
:type return_old: bool
3404
3370
:param return_new: Include body of the new document in the returned
3405
3371
metadata. Ignored if parameter **silent** is set to True.
3406
3372
:type return_new: bool
3407
- :return: Document metadata (e.g. document key, revision) or True if
3408
- parameter **silent** was set to True.
3409
- :rtype: bool | dict
3373
+ :return: Document metadata (e.g. document key, revision).
3374
+ :rtype: dict
3410
3375
:raise arango.exceptions.DocumentUpdateError: If update fails.
3411
3376
:raise arango.exceptions.DocumentRevisionError: If revisions mismatch.
3412
3377
"""
@@ -3415,7 +3380,6 @@ def update(
3415
3380
params : Params = {
3416
3381
"keepNull" : keep_none ,
3417
3382
"overwrite" : not check_rev ,
3418
- "silent" : silent ,
3419
3383
"returnNew" : return_new ,
3420
3384
"returnOld" : return_old ,
3421
3385
}
@@ -3431,13 +3395,11 @@ def update(
3431
3395
write = self .name ,
3432
3396
)
3433
3397
3434
- def response_handler (resp : Response ) -> Union [ bool , Json ] :
3398
+ def response_handler (resp : Response ) -> Json :
3435
3399
if resp .status_code == 412 : # pragma: no cover
3436
3400
raise DocumentRevisionError (resp , request )
3437
3401
if not resp .is_success :
3438
3402
raise DocumentUpdateError (resp , request )
3439
- if silent is True :
3440
- return True
3441
3403
return format_edge (resp .body )
3442
3404
3443
3405
return self ._execute (request , response_handler )
@@ -3447,10 +3409,9 @@ def replace(
3447
3409
edge : Json ,
3448
3410
check_rev : bool = True ,
3449
3411
sync : Optional [bool ] = None ,
3450
- silent : bool = False ,
3451
3412
return_old : bool = False ,
3452
3413
return_new : bool = False ,
3453
- ) -> Result [Union [ bool , Json ] ]:
3414
+ ) -> Result [Json ]:
3454
3415
"""Replace an edge document.
3455
3416
3456
3417
:param edge: New edge document to replace the old one with. It must
@@ -3462,25 +3423,20 @@ def replace(
3462
3423
:type check_rev: bool
3463
3424
:param sync: Block until operation is synchronized to disk.
3464
3425
:type sync: bool | None
3465
- :param silent: If set to True, no document metadata is returned. This
3466
- can be used to save resources.
3467
- :type silent: bool
3468
3426
:param return_old: Include body of the old document in the returned
3469
3427
metadata. Ignored if parameter **silent** is set to True.
3470
3428
:type return_old: bool
3471
3429
:param return_new: Include body of the new document in the returned
3472
3430
metadata. Ignored if parameter **silent** is set to True.
3473
3431
:type return_new: bool
3474
- :return: Document metadata (e.g. document key, revision) or True if
3475
- parameter **silent** was set to True.
3476
- :rtype: bool | dict
3432
+ :return: Document metadata (e.g. document key, revision).
3433
+ :rtype: dict
3477
3434
:raise arango.exceptions.DocumentReplaceError: If replace fails.
3478
3435
:raise arango.exceptions.DocumentRevisionError: If revisions mismatch.
3479
3436
"""
3480
3437
edge_id , headers = self ._prep_from_body (edge , check_rev )
3481
3438
3482
3439
params : Params = {
3483
- "silent" : silent ,
3484
3440
"returnNew" : return_new ,
3485
3441
"returnOld" : return_old ,
3486
3442
}
@@ -3496,13 +3452,11 @@ def replace(
3496
3452
write = self .name ,
3497
3453
)
3498
3454
3499
- def response_handler (resp : Response ) -> Union [ bool , Json ] :
3455
+ def response_handler (resp : Response ) -> Json :
3500
3456
if resp .status_code == 412 : # pragma: no cover
3501
3457
raise DocumentRevisionError (resp , request )
3502
3458
if not resp .is_success :
3503
3459
raise DocumentReplaceError (resp , request )
3504
- if silent is True :
3505
- return True
3506
3460
return format_edge (resp .body )
3507
3461
3508
3462
return self ._execute (request , response_handler )
@@ -3575,9 +3529,8 @@ def link(
3575
3529
to_vertex : Union [str , Json ],
3576
3530
data : Optional [Json ] = None ,
3577
3531
sync : Optional [bool ] = None ,
3578
- silent : bool = False ,
3579
3532
return_new : bool = False ,
3580
- ) -> Result [Union [ bool , Json ] ]:
3533
+ ) -> Result [Json ]:
3581
3534
"""Insert a new edge document linking the given vertices.
3582
3535
3583
3536
:param from_vertex: "From" vertex document ID or body with "_id" field.
@@ -3590,21 +3543,17 @@ def link(
3590
3543
:type data: dict | None
3591
3544
:param sync: Block until operation is synchronized to disk.
3592
3545
:type sync: bool | None
3593
- :param silent: If set to True, no document metadata is returned. This
3594
- can be used to save resources.
3595
- :type silent: bool
3596
3546
:param return_new: Include body of the new document in the returned
3597
3547
metadata. Ignored if parameter **silent** is set to True.
3598
3548
:type return_new: bool
3599
- :return: Document metadata (e.g. document key, revision) or True if
3600
- parameter **silent** was set to True.
3601
- :rtype: bool | dict
3549
+ :return: Document metadata (e.g. document key, revision).
3550
+ :rtype: dict
3602
3551
:raise arango.exceptions.DocumentInsertError: If insert fails.
3603
3552
"""
3604
3553
edge = {"_from" : get_doc_id (from_vertex ), "_to" : get_doc_id (to_vertex )}
3605
3554
if data is not None :
3606
3555
edge .update (self ._ensure_key_from_id (data ))
3607
- return self .insert (edge , sync = sync , silent = silent , return_new = return_new )
3556
+ return self .insert (edge , sync = sync , return_new = return_new )
3608
3557
3609
3558
def edges (
3610
3559
self ,
0 commit comments