22
33from __future__ import annotations
44
5+ import typing_extensions
56from typing import Iterable , Optional
67
78import httpx
@@ -62,6 +63,7 @@ def with_streaming_response(self) -> SecurityGroupsResourceWithStreamingResponse
6263 """
6364 return SecurityGroupsResourceWithStreamingResponse (self )
6465
66+ @typing_extensions .deprecated ("deprecated" )
6567 def create (
6668 self ,
6769 * ,
@@ -77,7 +79,7 @@ def create(
7779 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
7880 ) -> SecurityGroup :
7981 """
80- Create a new security group with the specified configuration .
82+ **Deprecated** Use `/v2/security_groups/<project_id>/<region_id>` instead .
8183
8284 Args:
8385 project_id: Project ID
@@ -115,6 +117,7 @@ def create(
115117 cast_to = SecurityGroup ,
116118 )
117119
120+ @typing_extensions .deprecated ("deprecated" )
118121 def update (
119122 self ,
120123 group_id : str ,
@@ -132,7 +135,8 @@ def update(
132135 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
133136 ) -> SecurityGroup :
134137 """
135- Update the configuration of an existing security group.
138+ **Deprecated** Use `/v2/security_groups/<project_id>/<region_id>/<group_id>`
139+ instead.
136140
137141 Args:
138142 project_id: Project ID
@@ -208,6 +212,7 @@ def list(
208212 project_id : int | None = None ,
209213 region_id : int | None = None ,
210214 limit : int | Omit = omit ,
215+ name : str | Omit = omit ,
211216 offset : int | Omit = omit ,
212217 tag_key : SequenceNotStr [str ] | Omit = omit ,
213218 tag_key_value : str | Omit = omit ,
@@ -228,6 +233,8 @@ def list(
228233
229234 limit: Limit of items on a single page
230235
236+ name: Optional. Filter by name. Must be specified a full name of the security group.
237+
231238 offset: Offset in results list
232239
233240 tag_key: Optional. Filter by tag keys. ?`tag_key`=key1&`tag_key`=key2
@@ -257,6 +264,7 @@ def list(
257264 query = maybe_transform (
258265 {
259266 "limit" : limit ,
267+ "name" : name ,
260268 "offset" : offset ,
261269 "tag_key" : tag_key ,
262270 "tag_key_value" : tag_key_value ,
@@ -477,6 +485,7 @@ def with_streaming_response(self) -> AsyncSecurityGroupsResourceWithStreamingRes
477485 """
478486 return AsyncSecurityGroupsResourceWithStreamingResponse (self )
479487
488+ @typing_extensions .deprecated ("deprecated" )
480489 async def create (
481490 self ,
482491 * ,
@@ -492,7 +501,7 @@ async def create(
492501 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
493502 ) -> SecurityGroup :
494503 """
495- Create a new security group with the specified configuration .
504+ **Deprecated** Use `/v2/security_groups/<project_id>/<region_id>` instead .
496505
497506 Args:
498507 project_id: Project ID
@@ -530,6 +539,7 @@ async def create(
530539 cast_to = SecurityGroup ,
531540 )
532541
542+ @typing_extensions .deprecated ("deprecated" )
533543 async def update (
534544 self ,
535545 group_id : str ,
@@ -547,7 +557,8 @@ async def update(
547557 timeout : float | httpx .Timeout | None | NotGiven = not_given ,
548558 ) -> SecurityGroup :
549559 """
550- Update the configuration of an existing security group.
560+ **Deprecated** Use `/v2/security_groups/<project_id>/<region_id>/<group_id>`
561+ instead.
551562
552563 Args:
553564 project_id: Project ID
@@ -623,6 +634,7 @@ def list(
623634 project_id : int | None = None ,
624635 region_id : int | None = None ,
625636 limit : int | Omit = omit ,
637+ name : str | Omit = omit ,
626638 offset : int | Omit = omit ,
627639 tag_key : SequenceNotStr [str ] | Omit = omit ,
628640 tag_key_value : str | Omit = omit ,
@@ -643,6 +655,8 @@ def list(
643655
644656 limit: Limit of items on a single page
645657
658+ name: Optional. Filter by name. Must be specified a full name of the security group.
659+
646660 offset: Offset in results list
647661
648662 tag_key: Optional. Filter by tag keys. ?`tag_key`=key1&`tag_key`=key2
@@ -672,6 +686,7 @@ def list(
672686 query = maybe_transform (
673687 {
674688 "limit" : limit ,
689+ "name" : name ,
675690 "offset" : offset ,
676691 "tag_key" : tag_key ,
677692 "tag_key_value" : tag_key_value ,
@@ -872,11 +887,15 @@ class SecurityGroupsResourceWithRawResponse:
872887 def __init__ (self , security_groups : SecurityGroupsResource ) -> None :
873888 self ._security_groups = security_groups
874889
875- self .create = to_raw_response_wrapper (
876- security_groups .create ,
890+ self .create = ( # pyright: ignore[reportDeprecated]
891+ to_raw_response_wrapper (
892+ security_groups .create , # pyright: ignore[reportDeprecated],
893+ )
877894 )
878- self .update = to_raw_response_wrapper (
879- security_groups .update ,
895+ self .update = ( # pyright: ignore[reportDeprecated]
896+ to_raw_response_wrapper (
897+ security_groups .update , # pyright: ignore[reportDeprecated],
898+ )
880899 )
881900 self .list = to_raw_response_wrapper (
882901 security_groups .list ,
@@ -903,11 +922,15 @@ class AsyncSecurityGroupsResourceWithRawResponse:
903922 def __init__ (self , security_groups : AsyncSecurityGroupsResource ) -> None :
904923 self ._security_groups = security_groups
905924
906- self .create = async_to_raw_response_wrapper (
907- security_groups .create ,
925+ self .create = ( # pyright: ignore[reportDeprecated]
926+ async_to_raw_response_wrapper (
927+ security_groups .create , # pyright: ignore[reportDeprecated],
928+ )
908929 )
909- self .update = async_to_raw_response_wrapper (
910- security_groups .update ,
930+ self .update = ( # pyright: ignore[reportDeprecated]
931+ async_to_raw_response_wrapper (
932+ security_groups .update , # pyright: ignore[reportDeprecated],
933+ )
911934 )
912935 self .list = async_to_raw_response_wrapper (
913936 security_groups .list ,
@@ -934,11 +957,15 @@ class SecurityGroupsResourceWithStreamingResponse:
934957 def __init__ (self , security_groups : SecurityGroupsResource ) -> None :
935958 self ._security_groups = security_groups
936959
937- self .create = to_streamed_response_wrapper (
938- security_groups .create ,
960+ self .create = ( # pyright: ignore[reportDeprecated]
961+ to_streamed_response_wrapper (
962+ security_groups .create , # pyright: ignore[reportDeprecated],
963+ )
939964 )
940- self .update = to_streamed_response_wrapper (
941- security_groups .update ,
965+ self .update = ( # pyright: ignore[reportDeprecated]
966+ to_streamed_response_wrapper (
967+ security_groups .update , # pyright: ignore[reportDeprecated],
968+ )
942969 )
943970 self .list = to_streamed_response_wrapper (
944971 security_groups .list ,
@@ -965,11 +992,15 @@ class AsyncSecurityGroupsResourceWithStreamingResponse:
965992 def __init__ (self , security_groups : AsyncSecurityGroupsResource ) -> None :
966993 self ._security_groups = security_groups
967994
968- self .create = async_to_streamed_response_wrapper (
969- security_groups .create ,
995+ self .create = ( # pyright: ignore[reportDeprecated]
996+ async_to_streamed_response_wrapper (
997+ security_groups .create , # pyright: ignore[reportDeprecated],
998+ )
970999 )
971- self .update = async_to_streamed_response_wrapper (
972- security_groups .update ,
1000+ self .update = ( # pyright: ignore[reportDeprecated]
1001+ async_to_streamed_response_wrapper (
1002+ security_groups .update , # pyright: ignore[reportDeprecated],
1003+ )
9731004 )
9741005 self .list = async_to_streamed_response_wrapper (
9751006 security_groups .list ,
0 commit comments