@@ -492,26 +492,31 @@ class ConflictReason(object):
492492 Folder = object ()
493493 File = object ()
494494 AutorenameFailed = object ()
495+ Unknown = object ()
495496
496497 def __init__ (self ,
497498 folder = None ,
498499 file = None ,
499500 autorename_failed = None ,
501+ unknown = None ,
500502 ** kwargs ):
501503 """
502504 Only one argument can be set.
503505
504506 :param bool folder: Conflict with a folder.
505507 :param bool file: Conflict with a file.
506508 :param bool autorename_failed: Could not autorename.
509+ :type unknown: bool
507510 """
508511 assert_only_one (folder = folder ,
509512 file = file ,
510513 autorename_failed = autorename_failed ,
514+ unknown = unknown ,
511515 ** kwargs )
512516 self .folder = None
513517 self .file = None
514518 self .autorename_failed = None
519+ self .unknown = None
515520
516521 if folder is not None :
517522 assert isinstance (folder , bool ), 'folder must be of type bool'
@@ -528,6 +533,11 @@ def __init__(self,
528533 self .autorename_failed = autorename_failed
529534 self ._tag = 'autorename_failed'
530535
536+ if unknown is not None :
537+ assert isinstance (unknown , bool ), 'unknown must be of type bool'
538+ self .unknown = unknown
539+ self ._tag = 'unknown'
540+
531541 def is_folder (self ):
532542 return self ._tag == 'folder'
533543
@@ -537,6 +547,9 @@ def is_file(self):
537547 def is_autorename_failed (self ):
538548 return self ._tag == 'autorename_failed'
539549
550+ def is_unknown (self ):
551+ return self ._tag == 'unknown'
552+
540553 @classmethod
541554 def from_json (self , obj ):
542555 obj = copy .copy (obj )
@@ -547,6 +560,8 @@ def from_json(self, obj):
547560 return obj
548561 if obj == 'autorename_failed' :
549562 return obj
563+ if obj == 'unknown' :
564+ return obj
550565 return ConflictReason (** obj )
551566
552567 def to_json (self ):
@@ -556,6 +571,8 @@ def to_json(self):
556571 return self ._tag
557572 if self ._tag == 'autorename_failed' :
558573 return self ._tag
574+ if self ._tag == 'unknown' :
575+ return self ._tag
559576
560577 def __repr__ (self ):
561578 return 'ConflictReason(%r)' % self ._tag
@@ -574,6 +591,8 @@ def __init__(self,
574591 self .reason = ConflictReason (file = True )
575592 if reason == ConflictReason .AutorenameFailed :
576593 self .reason = ConflictReason (autorename_failed = True )
594+ if reason == ConflictReason .Unknown :
595+ self .reason = ConflictReason (unknown = True )
577596
578597 @classmethod
579598 def from_json (cls , obj ):
0 commit comments