@@ -16,53 +16,53 @@ class Alerts(resource.BaseResource):
1616 "record_ids" ,
1717 "zone_names" ,
1818 ]
19-
19+
2020 # Forward HTTP methods needed by UsageAlertsAPI
2121 def _get (self , path , params = None ):
2222 """Forward GET requests to make_request"""
2323 # Fix path to start with /alerting/v1/ if needed
24- if path .startswith ('/' ):
24+ if path .startswith ("/" ):
2525 path = path [1 :] # Remove leading slash
2626 if not path .startswith ("alerting/v1/" ):
2727 # Alerting endpoints should have this prefix
2828 path = f"{ self .ROOT } /{ path .split ('/' )[- 1 ]} "
2929 return self ._make_request ("GET" , path , params = params )
30-
30+
3131 def _post (self , path , json = None ):
3232 """Forward POST requests to make_request"""
33- if path .startswith ('/' ):
33+ if path .startswith ("/" ):
3434 path = path [1 :] # Remove leading slash
3535 if not path .startswith ("alerting/v1/" ):
3636 path = f"{ self .ROOT } "
3737 return self ._make_request ("POST" , path , body = json )
38-
38+
3939 def _patch (self , path , json = None ):
4040 """Forward PATCH requests to make_request"""
41- if path .startswith ('/' ):
41+ if path .startswith ("/" ):
4242 path = path [1 :] # Remove leading slash
4343 if not path .startswith ("alerting/v1/" ):
44- parts = path .split ('/' )
44+ parts = path .split ("/" )
4545 path = f"{ self .ROOT } /{ parts [- 1 ]} "
4646 return self ._make_request ("PATCH" , path , body = json )
47-
47+
4848 def _delete (self , path ):
4949 """Forward DELETE requests to make_request"""
50- if path .startswith ('/' ):
50+ if path .startswith ("/" ):
5151 path = path [1 :] # Remove leading slash
5252 if not path .startswith ("alerting/v1/" ):
53- parts = path .split ('/' )
53+ parts = path .split ("/" )
5454 path = f"{ self .ROOT } /{ parts [- 1 ]} "
5555 return self ._make_request ("DELETE" , path )
56-
56+
5757 def __init__ (self , config ):
5858 super (Alerts , self ).__init__ (config )
5959 self ._usage_api = None
60-
60+
6161 @property
6262 def usage (self ):
6363 """
6464 Return interface to usage alerts operations
65-
65+
6666 :return: :py:class:`ns1.alerting.UsageAlertsAPI`
6767 """
6868 if self ._usage_api is None :
0 commit comments