@@ -215,7 +215,7 @@ def project(self, project_id: str) -> t.Dict[str, t.Any]:
215
215
216
216
return self ._request ("GET" , r_path )
217
217
218
- @returns_model (schema .ConnectionUri )
218
+ @returns_model (schema .ConnectionURIResponse )
219
219
def connection_uri (
220
220
self ,
221
221
project_id : str ,
@@ -797,37 +797,3 @@ def operation(self, project_id: str, operation_id: str) -> t.Dict[str, t.Any]:
797
797
return self ._request (
798
798
"GET" , f"projects/{ project_id } /operations/{ operation_id } "
799
799
)
800
-
801
- @returns_model (schema .ProjectsConsumptionResponse )
802
- def consumption (
803
- self ,
804
- * ,
805
- cursor : str = None ,
806
- limit : int = None ,
807
- from_date : datetime = None ,
808
- to_date : datetime = None ,
809
- ) -> t .Dict [str , t .Any ]:
810
- """Experimental — get a list of consumption metrics for all projects.
811
-
812
- :param cursor: The cursor for pagination (default is None).
813
- :param limit: The maximum number of projects to retrieve (default is None).
814
- :param from_date: The start date for the consumption metrics (default is None).
815
- :param to_date: The end date for the consumption metrics (default is None).
816
- :return: A dataclass representing the consumption metrics.
817
-
818
- More info: https://api-docs.neon.tech/reference/listprojectsconsumption
819
- """
820
-
821
- # Convert datetime objects to ISO 8601 strings.
822
- from_date = (
823
- to_iso8601 (from_date ) if isinstance (from_date , datetime ) else from_date
824
- )
825
- to_date = to_iso8601 (to_date ) if isinstance (to_date , datetime ) else to_date
826
-
827
- # Construct the request parameters.
828
- r_params = compact_mapping (
829
- {"cursor" : cursor , "limit" : limit , "from" : from_date , "to" : to_date }
830
- )
831
-
832
- # Make the request.
833
- return self ._request ("GET" , "consumption/projects" , params = r_params )
0 commit comments