@@ -38,8 +38,9 @@ class KeyVaultAccessControlClient(KeyVaultClientBase):
3838 # pylint:disable=protected-access
3939
4040 @distributed_trace
41- def create_role_assignment (self , scope , definition_id , principal_id , ** kwargs ):
42- # type: (Union[str, KeyVaultRoleScope], str, str, **Any) -> KeyVaultRoleAssignment
41+ def create_role_assignment (
42+ self , scope : "Union[str, KeyVaultRoleScope]" , definition_id : str , principal_id : str , ** kwargs
43+ ) -> KeyVaultRoleAssignment :
4344 """Create a role assignment.
4445
4546 :param scope: scope the role assignment will apply over. :class:`KeyVaultRoleScope` defines common
@@ -48,8 +49,10 @@ def create_role_assignment(self, scope, definition_id, principal_id, **kwargs):
4849 :param str definition_id: ID of the role's definition
4950 :param str principal_id: Azure Active Directory object ID of the principal which will be assigned the role. The
5051 principal can be a user, service principal, or security group.
52+
5153 :keyword name: a name for the role assignment. Must be a UUID.
5254 :paramtype name: str or uuid.UUID
55+
5356 :rtype: ~azure.keyvault.administration.KeyVaultRoleAssignment
5457 """
5558 name = kwargs .pop ("name" , None ) or uuid4 ()
@@ -69,15 +72,17 @@ def create_role_assignment(self, scope, definition_id, principal_id, **kwargs):
6972 return KeyVaultRoleAssignment ._from_generated (assignment )
7073
7174 @distributed_trace
72- def delete_role_assignment (self , scope , name , ** kwargs ):
73- # type: (Union[str, KeyVaultRoleScope], Union[str, UUID], **Any) -> None
75+ def delete_role_assignment (
76+ self , scope : "Union[str, KeyVaultRoleScope]" , name : "Union[str, UUID]" , ** kwargs
77+ ) -> None :
7478 """Delete a role assignment.
7579
7680 :param scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>"
7781 :class:`KeyVaultRoleScope` defines common broad scopes. Specify a narrower scope as a string.
7882 :type scope: str or KeyVaultRoleScope
7983 :param name: the role assignment's name.
8084 :type name: str or uuid.UUID
85+
8186 :returns: None
8287 """
8388 try :
@@ -88,15 +93,17 @@ def delete_role_assignment(self, scope, name, **kwargs):
8893 pass
8994
9095 @distributed_trace
91- def get_role_assignment (self , scope , name , ** kwargs ):
92- # type: (Union[str, KeyVaultRoleScope], Union[str, UUID], **Any) -> KeyVaultRoleAssignment
96+ def get_role_assignment (
97+ self , scope : "Union[str, KeyVaultRoleScope]" , name : "Union[str, UUID]" , ** kwargs
98+ ) -> KeyVaultRoleAssignment :
9399 """Get a role assignment.
94100
95101 :param scope: the assignment's scope, for example "/", "/keys", or "/keys/<specific key identifier>"
96102 :class:`KeyVaultRoleScope` defines common broad scopes. Specify a narrower scope as a string.
97103 :type scope: str or KeyVaultRoleScope
98104 :param name: the role assignment's name.
99105 :type name: str or uuid.UUID
106+
100107 :rtype: ~azure.keyvault.administration.KeyVaultRoleAssignment
101108 """
102109 assignment = self ._client .role_assignments .get (
@@ -105,13 +112,15 @@ def get_role_assignment(self, scope, name, **kwargs):
105112 return KeyVaultRoleAssignment ._from_generated (assignment )
106113
107114 @distributed_trace
108- def list_role_assignments (self , scope , ** kwargs ):
109- # type: (Union[str, KeyVaultRoleScope], **Any) -> ItemPaged[KeyVaultRoleAssignment]
115+ def list_role_assignments (
116+ self , scope : "Union[str, KeyVaultRoleScope]" , ** kwargs
117+ ) -> "ItemPaged[KeyVaultRoleAssignment]" :
110118 """List all role assignments for a scope.
111119
112120 :param scope: scope of the role assignments. :class:`KeyVaultRoleScope` defines common broad scopes.
113121 Specify a narrower scope as a string.
114122 :type scope: str or KeyVaultRoleScope
123+
115124 :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.administration.KeyVaultRoleAssignment]
116125 """
117126 return self ._client .role_assignments .list_for_scope (
@@ -122,15 +131,17 @@ def list_role_assignments(self, scope, **kwargs):
122131 )
123132
124133 @distributed_trace
125- def set_role_definition (self , scope , ** kwargs ):
126- # type: (Union[str, KeyVaultRoleScope], **Any) -> KeyVaultRoleDefinition
134+ def set_role_definition (
135+ self , scope : "Union[str, KeyVaultRoleScope]" , ** kwargs
136+ ) -> "KeyVaultRoleDefinition" :
127137 """Creates or updates a custom role definition.
128138
129139 To update a role definition, specify the definition's ``name``.
130140
131141 :param scope: scope of the role definition. :class:`KeyVaultRoleScope` defines common broad scopes.
132142 Specify a narrower scope as a string. Managed HSM only supports '/', or KeyVaultRoleScope.GLOBAL.
133143 :type scope: str or KeyVaultRoleScope
144+
134145 :keyword name: the role definition's name, a UUID. When this argument has a value, the client will create a new
135146 role definition with this name or update an existing role definition, if one exists with the given name.
136147 When this argument has no value, a new role definition will be created with a generated name.
@@ -144,6 +155,7 @@ def set_role_definition(self, scope, **kwargs):
144155 :paramtype permissions: Iterable[KeyVaultPermission]
145156 :keyword assignable_scopes: the scopes for which the role definition can be assigned.
146157 :paramtype assignable_scopes: Iterable[str] or Iterable[KeyVaultRoleScope]
158+
147159 :returns: The created or updated role definition
148160 :rtype: ~azure.keyvault.administration.KeyVaultRoleDefinition
149161 """
@@ -175,15 +187,17 @@ def set_role_definition(self, scope, **kwargs):
175187 return KeyVaultRoleDefinition ._from_generated (definition )
176188
177189 @distributed_trace
178- def get_role_definition (self , scope , name , ** kwargs ):
179- # type: (Union[str, KeyVaultRoleScope], Union[str, UUID], **Any) -> KeyVaultRoleDefinition
190+ def get_role_definition (
191+ self , scope : "Union[str, KeyVaultRoleScope]" , name : "Union[str, UUID]" , ** kwargs
192+ ) -> "KeyVaultRoleDefinition" :
180193 """Get the specified role definition.
181194
182195 :param scope: scope of the role definition. :class:`KeyVaultRoleScope` defines common broad scopes.
183196 Specify a narrower scope as a string. Managed HSM only supports '/', or KeyVaultRoleScope.GLOBAL.
184197 :type scope: str or KeyVaultRoleScope
185198 :param name: the role definition's name.
186199 :type name: str or uuid.UUID
200+
187201 :rtype: ~azure.keyvault.administration.KeyVaultRoleDefinition
188202 """
189203 definition = self ._client .role_definitions .get (
@@ -192,15 +206,17 @@ def get_role_definition(self, scope, name, **kwargs):
192206 return KeyVaultRoleDefinition ._from_generated (definition )
193207
194208 @distributed_trace
195- def delete_role_definition (self , scope , name , ** kwargs ):
196- # type: (Union[str, KeyVaultRoleScope], Union[str, UUID], **Any) -> None
209+ def delete_role_definition (
210+ self , scope : "Union[str, KeyVaultRoleScope]" , name : "Union[str, UUID]" , ** kwargs
211+ ) -> None :
197212 """Deletes a custom role definition.
198213
199214 :param scope: scope of the role definition. :class:`KeyVaultRoleScope` defines common broad scopes.
200215 Specify a narrower scope as a string. Managed HSM only supports '/', or KeyVaultRoleScope.GLOBAL.
201216 :type scope: str or KeyVaultRoleScope
202217 :param name: the role definition's name.
203218 :type name: str or uuid.UUID
219+
204220 :returns: None
205221 """
206222 try :
@@ -211,13 +227,15 @@ def delete_role_definition(self, scope, name, **kwargs):
211227 pass
212228
213229 @distributed_trace
214- def list_role_definitions (self , scope , ** kwargs ):
215- # type: (Union[str, KeyVaultRoleScope], **Any) -> ItemPaged[KeyVaultRoleDefinition]
230+ def list_role_definitions (
231+ self , scope : "Union[str, KeyVaultRoleScope]" , ** kwargs
232+ ) -> "ItemPaged[KeyVaultRoleDefinition]" :
216233 """List all role definitions applicable at and above a scope.
217234
218235 :param scope: scope of the role definitions. :class:`KeyVaultRoleScope` defines common broad scopes.
219236 Specify a narrower scope as a string.
220237 :type scope: str or KeyVaultRoleScope
238+
221239 :rtype: ~azure.core.paging.ItemPaged[~azure.keyvault.administration.KeyVaultRoleDefinition]
222240 """
223241 return self ._client .role_definitions .list (
0 commit comments