from enum import Enum, auto


class EndpointType(Enum):
    # endpoint / collection types
    GCP = auto()
    GCSV5_ENDPOINT = auto()
    GUEST_COLLECTION = auto()
    MAPPED_COLLECTION = auto()
    SHARE = auto()
    NON_GCSV5_ENDPOINT = auto()  # most likely GCSv4, but not necessarily


def determine_endpoint_type(ep_doc: dict) -> EndpointType:
    """
    Given an endpoint document from transfer, determine what type of
    endpoint or collection it is for
    """
    if ep_doc["is_globus_connect"] is True:
        return EndpointType.GCP

    if ep_doc["non_functional"] is True:
        return EndpointType.GCSV5_ENDPOINT

    shared = ep_doc["host_endpoint_id"] is not None

    if ep_doc["gcs_version"]:
        major, minor, patch = ep_doc["gcs_version"].split(".")
        gcsv5 = major == "5"
    else:
        gcsv5 = False

    if gcsv5:
        if shared:
            return EndpointType.GUEST_COLLECTION
        else:
            return EndpointType.MAPPED_COLLECTION

    elif shared:
        return EndpointType.SHARE

    return EndpointType.NON_GCSV5_ENDPOINT

@@ -283,17 +283,37 @@
 sarily%0A%0A
-%0A
+    @classmethod%0A    
 def dete
@@ -332,16 +332,21 @@
 nt_type(
+cls, 
 ep_doc: 
@@ -354,16 +354,17 @@
 ict) -%3E 
+%22
 Endpoint
@@ -371,18 +371,27 @@
 Type
+%22
 :%0A    
+  
+  
 %22%22%22%0A
+    
     
@@ -455,16 +455,20 @@
 type of%0A
+    
     endp
@@ -496,16 +496,20 @@
  is for%0A
+    
     %22%22%22%0A
@@ -508,24 +508,28 @@
     %22%22%22%0A    
+ 
+   
 if ep_doc%5B%22i
@@ -548,32 +548,36 @@
 nect%22%5D is True:%0A
+    
         return E
@@ -593,16 +593,20 @@
 pe.GCP%0A%0A
+    
     if e
@@ -638,32 +638,36 @@
 s True:%0A        
+   
+ 
 return EndpointT
@@ -686,16 +686,20 @@
 DPOINT%0A%0A
+    
     shar
@@ -743,24 +743,28 @@
 t None%0A%0A    
+   
+ 
 if ep_doc%5B%22g
@@ -777,16 +777,20 @@
 sion%22%5D:%0A
+    
         
@@ -844,32 +844,36 @@
 it(%22.%22)%0A        
+  
+  
 gcsv5 = major ==
@@ -877,16 +877,20 @@
  == %225%22%0A
+    
     else
@@ -891,32 +891,36 @@
   else:%0A        
+ 
+   
 gcsv5 = False%0A%0A 
@@ -918,16 +918,20 @@
  False%0A%0A
+    
     if g
@@ -944,16 +944,20 @@
         
+    
 if share
@@ -951,32 +951,36 @@
      if shared:%0A
+    
             retu
@@ -1012,32 +1012,36 @@
 LECTION%0A        
+    
 else:%0A          
@@ -1034,32 +1034,36 @@
 se:%0A            
+  
+  
 return EndpointT
@@ -1085,16 +1085,20 @@
 ECTION%0A%0A
+    
     elif
@@ -1106,32 +1106,36 @@
 shared:%0A        
+ 
+   
 return EndpointT
@@ -1145,16 +1145,20 @@
 .SHARE%0A%0A
+    
     retu

make determine_endpoint_type a classmethod