diff --git a/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md b/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md index 93cd6232c8e6..1b2c5b54acae 100644 --- a/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md +++ b/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md @@ -1,5 +1,23 @@ # Release History +## 2.1.0 (2024-03-18) + +### Features Added + + - Added operation AccessOperations.create_role_binding + - Added operation AccessOperations.delete_role_binding + - Added operation AccessOperations.list_role_binding_name_list + - Added operation OrganizationOperations.create_api_key + - Added operation OrganizationOperations.delete_cluster_api_key + - Added operation OrganizationOperations.get_cluster_api_key + - Added operation OrganizationOperations.get_cluster_by_id + - Added operation OrganizationOperations.get_environment_by_id + - Added operation OrganizationOperations.get_schema_registry_cluster_by_id + - Added operation OrganizationOperations.list_clusters + - Added operation OrganizationOperations.list_environments + - Added operation OrganizationOperations.list_regions + - Added operation OrganizationOperations.list_schema_registry_clusters + ## 2.0.0 (2023-11-20) ### Features Added diff --git a/sdk/confluent/azure-mgmt-confluent/README.md b/sdk/confluent/azure-mgmt-confluent/README.md index 50af45885c79..bca9c3ccb8d1 100644 --- a/sdk/confluent/azure-mgmt-confluent/README.md +++ b/sdk/confluent/azure-mgmt-confluent/README.md @@ -1,7 +1,7 @@ # Microsoft Azure SDK for Python This is the Microsoft Azure Confluent Management Client Library. -This package has been tested with Python 3.7+. +This package has been tested with Python 3.8+. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). ## _Disclaimer_ @@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For ### Prerequisites -- Python 3.7+ is required to use this package. +- Python 3.8+ is required to use this package. - [Azure subscription](https://azure.microsoft.com/free/) ### Install the package diff --git a/sdk/confluent/azure-mgmt-confluent/_meta.json b/sdk/confluent/azure-mgmt-confluent/_meta.json index e6d708fbc07e..11dbcd04b1dc 100644 --- a/sdk/confluent/azure-mgmt-confluent/_meta.json +++ b/sdk/confluent/azure-mgmt-confluent/_meta.json @@ -1,5 +1,5 @@ { - "commit": "58e92dd03733bc175e6a9540f4bc53703b57fcc9", + "commit": "cf5ad1932d00c7d15497705ad6b71171d3d68b1e", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.9.7", "use": [ diff --git a/sdk/confluent/azure-mgmt-confluent/assets.json b/sdk/confluent/azure-mgmt-confluent/assets.json index 6cba0129f3c1..5c1bc54ff454 100644 --- a/sdk/confluent/azure-mgmt-confluent/assets.json +++ b/sdk/confluent/azure-mgmt-confluent/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "python", "TagPrefix": "python/confluent/azure-mgmt-confluent", - "Tag": "python/confluent/azure-mgmt-confluent_69ba061428" + "Tag": "python/confluent/azure-mgmt-confluent_4eb7f31513" } \ No newline at end of file diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_configuration.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_configuration.py index cb0b99cb69d1..dc3349717e2d 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_configuration.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_configuration.py @@ -27,16 +27,16 @@ class ConfluentManagementClientConfiguration(Configuration): # pylint: disable= :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: Microsoft Azure subscription id. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-08-22". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-02-13". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ConfluentManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-08-22") + api_version: str = kwargs.pop("api_version", "2024-02-13") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_confluent_management_client.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_confluent_management_client.py index f2c4e51ec87a..4a019eb317d8 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_confluent_management_client.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_confluent_management_client.py @@ -45,11 +45,11 @@ class ConfluentManagementClient: # pylint: disable=client-accepts-api-version-k :vartype access: azure.mgmt.confluent.operations.AccessOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: Microsoft Azure subscription id. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-08-22". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-02-13". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_version.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_version.py index 48944bf3938a..83f24ab50946 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_version.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "2.1.0" diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_configuration.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_configuration.py index ffdb3398a6b1..2790cdc16d52 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_configuration.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_configuration.py @@ -27,16 +27,16 @@ class ConfluentManagementClientConfiguration(Configuration): # pylint: disable= :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: Microsoft Azure subscription id. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2023-08-22". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-02-13". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: super(ConfluentManagementClientConfiguration, self).__init__(**kwargs) - api_version: str = kwargs.pop("api_version", "2023-08-22") + api_version: str = kwargs.pop("api_version", "2024-02-13") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_confluent_management_client.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_confluent_management_client.py index b7a3a8c8e535..dcee894d81b4 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_confluent_management_client.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_confluent_management_client.py @@ -45,11 +45,11 @@ class ConfluentManagementClient: # pylint: disable=client-accepts-api-version-k :vartype access: azure.mgmt.confluent.aio.operations.AccessOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. + :param subscription_id: Microsoft Azure subscription id. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2023-08-22". Note that overriding this + :keyword api_version: Api Version. Default value is "2024-02-13". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_access_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_access_operations.py index 156a232485a4..754cb6ab7441 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_access_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_access_operations.py @@ -27,10 +27,13 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._access_operations import ( + build_create_role_binding_request, + build_delete_role_binding_request, build_invite_user_request, build_list_clusters_request, build_list_environments_request, build_list_invitations_request, + build_list_role_binding_name_list_request, build_list_role_bindings_request, build_list_service_accounts_request, build_list_users_request, @@ -73,8 +76,7 @@ async def list_users( Organization users details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -103,8 +105,7 @@ async def list_users( Organization users details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -131,8 +132,7 @@ async def list_users( Organization users details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -224,8 +224,7 @@ async def list_service_accounts( Organization service accounts details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -254,8 +253,7 @@ async def list_service_accounts( Organization service accounts details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -282,8 +280,7 @@ async def list_service_accounts( Organization service accounts details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -375,8 +372,7 @@ async def list_invitations( Organization accounts invitation details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -405,8 +401,7 @@ async def list_invitations( Organization accounts invitation details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -433,8 +428,7 @@ async def list_invitations( Organization accounts invitation details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -526,8 +520,7 @@ async def invite_user( Invite user to the organization. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -556,8 +549,7 @@ async def invite_user( Invite user to the organization. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -584,8 +576,7 @@ async def invite_user( Invite user to the organization. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -1115,3 +1106,373 @@ async def list_role_bindings( list_role_bindings.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/listRoleBindings" } + + @overload + async def create_role_binding( + self, + resource_group_name: str, + organization_name: str, + body: _models.AccessCreateRoleBindingRequestModel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RoleBindingRecord: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Create role binding Request Model. Required. + :type body: ~azure.mgmt.confluent.models.AccessCreateRoleBindingRequestModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RoleBindingRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.RoleBindingRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_role_binding( + self, + resource_group_name: str, + organization_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RoleBindingRecord: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Create role binding Request Model. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RoleBindingRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.RoleBindingRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_role_binding( + self, + resource_group_name: str, + organization_name: str, + body: Union[_models.AccessCreateRoleBindingRequestModel, IO], + **kwargs: Any + ) -> _models.RoleBindingRecord: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Create role binding Request Model. Is either a AccessCreateRoleBindingRequestModel + type or a IO type. Required. + :type body: ~azure.mgmt.confluent.models.AccessCreateRoleBindingRequestModel or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RoleBindingRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.RoleBindingRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoleBindingRecord] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "AccessCreateRoleBindingRequestModel") + + request = build_create_role_binding_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_role_binding.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RoleBindingRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_role_binding.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/createRoleBinding" + } + + @distributed_trace_async + async def delete_role_binding( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, organization_name: str, role_binding_id: str, **kwargs: Any + ) -> None: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param role_binding_id: Confluent Role binding id. Required. + :type role_binding_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_role_binding_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + role_binding_id=role_binding_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.delete_role_binding.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_role_binding.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/deleteRoleBinding/{roleBindingId}" + } + + @overload + async def list_role_binding_name_list( + self, + resource_group_name: str, + organization_name: str, + body: _models.ListAccessRequestModel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AccessRoleBindingNameListSuccessResponse: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessRoleBindingNameListSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.AccessRoleBindingNameListSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_role_binding_name_list( + self, + resource_group_name: str, + organization_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AccessRoleBindingNameListSuccessResponse: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessRoleBindingNameListSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.AccessRoleBindingNameListSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_role_binding_name_list( + self, + resource_group_name: str, + organization_name: str, + body: Union[_models.ListAccessRequestModel, IO], + **kwargs: Any + ) -> _models.AccessRoleBindingNameListSuccessResponse: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Is either a ListAccessRequestModel type or a IO type. + Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessRoleBindingNameListSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.AccessRoleBindingNameListSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AccessRoleBindingNameListSuccessResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "ListAccessRequestModel") + + request = build_list_role_binding_name_list_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_role_binding_name_list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AccessRoleBindingNameListSuccessResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_role_binding_name_list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/listRoleBindingNameList" + } diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations.py index 3a137004d511..7db41c66bcf5 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations.py @@ -32,11 +32,21 @@ from ... import models as _models from ..._vendor import _convert_request from ...operations._organization_operations import ( + build_create_api_key_request, build_create_request, + build_delete_cluster_api_key_request, build_delete_request, + build_get_cluster_api_key_request, + build_get_cluster_by_id_request, + build_get_environment_by_id_request, build_get_request, + build_get_schema_registry_cluster_by_id_request, build_list_by_resource_group_request, build_list_by_subscription_request, + build_list_clusters_request, + build_list_environments_request, + build_list_regions_request, + build_list_schema_registry_clusters_request, build_update_request, ) @@ -160,8 +170,7 @@ def list_by_resource_group( List all Organizations under the specified resource group. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OrganizationResource or the result of @@ -255,8 +264,7 @@ async def get( Get the properties of a specific Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -407,8 +415,7 @@ async def begin_create( Create Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -445,8 +452,7 @@ async def begin_create( Create Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -481,8 +487,7 @@ async def begin_create( Create Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -570,8 +575,7 @@ async def update( Update Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -600,8 +604,7 @@ async def update( Update Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -628,8 +631,7 @@ async def update( Update Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -768,8 +770,7 @@ async def begin_delete( Delete Organization resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -829,3 +830,1024 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- begin_delete.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" } + + @distributed_trace + def list_environments( + self, + resource_group_name: str, + organization_name: str, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SCEnvironmentRecord"]: + """Lists of all the environments in a organization. + + Lists of all the environments in a organization. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param page_size: Pagination size. Default value is None. + :type page_size: int + :param page_token: An opaque pagination token to fetch the next set of records. Default value + is None. + :type page_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SCEnvironmentRecord or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.confluent.models.SCEnvironmentRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GetEnvironmentsResponse] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_environments_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + page_size=page_size, + page_token=page_token, + api_version=api_version, + template_url=self.list_environments.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GetEnvironmentsResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_environments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments" + } + + @distributed_trace_async + async def get_environment_by_id( + self, resource_group_name: str, organization_name: str, environment_id: str, **kwargs: Any + ) -> _models.SCEnvironmentRecord: + """Get Environment details by environment Id. + + Get Environment details by environment Id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SCEnvironmentRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.SCEnvironmentRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SCEnvironmentRecord] = kwargs.pop("cls", None) + + request = build_get_environment_by_id_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_environment_by_id.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SCEnvironmentRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_environment_by_id.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}" + } + + @distributed_trace + def list_clusters( + self, + resource_group_name: str, + organization_name: str, + environment_id: str, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SCClusterRecord"]: + """Lists of all the clusters in a environment. + + Lists of all the clusters in a environment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param page_size: Pagination size. Default value is None. + :type page_size: int + :param page_token: An opaque pagination token to fetch the next set of records. Default value + is None. + :type page_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SCClusterRecord or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.confluent.models.SCClusterRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ListClustersSuccessResponse] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_clusters_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + subscription_id=self._config.subscription_id, + page_size=page_size, + page_token=page_token, + api_version=api_version, + template_url=self.list_clusters.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListClustersSuccessResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_clusters.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters" + } + + @distributed_trace + def list_schema_registry_clusters( + self, + resource_group_name: str, + organization_name: str, + environment_id: str, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any + ) -> AsyncIterable["_models.SchemaRegistryClusterRecord"]: + """Get schema registry clusters. + + Get schema registry clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param page_size: Pagination size. Default value is None. + :type page_size: int + :param page_token: An opaque pagination token to fetch the next set of records. Default value + is None. + :type page_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SchemaRegistryClusterRecord or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.confluent.models.SchemaRegistryClusterRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ListSchemaRegistryClustersResponse] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_schema_registry_clusters_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + subscription_id=self._config.subscription_id, + page_size=page_size, + page_token=page_token, + api_version=api_version, + template_url=self.list_schema_registry_clusters.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ListSchemaRegistryClustersResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + list_schema_registry_clusters.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/schemaRegistryClusters" + } + + @overload + async def list_regions( + self, + resource_group_name: str, + organization_name: str, + body: _models.ListAccessRequestModel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ListRegionsSuccessResponse: + """cloud provider regions available for creating Schema Registry clusters. + + cloud provider regions available for creating Schema Registry clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListRegionsSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.ListRegionsSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def list_regions( + self, + resource_group_name: str, + organization_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ListRegionsSuccessResponse: + """cloud provider regions available for creating Schema Registry clusters. + + cloud provider regions available for creating Schema Registry clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListRegionsSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.ListRegionsSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def list_regions( + self, + resource_group_name: str, + organization_name: str, + body: Union[_models.ListAccessRequestModel, IO], + **kwargs: Any + ) -> _models.ListRegionsSuccessResponse: + """cloud provider regions available for creating Schema Registry clusters. + + cloud provider regions available for creating Schema Registry clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Is either a ListAccessRequestModel type or a IO type. + Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ListRegionsSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.ListRegionsSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ListRegionsSuccessResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "ListAccessRequestModel") + + request = build_list_regions_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_regions.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ListRegionsSuccessResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_regions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/listRegions" + } + + @overload + async def create_api_key( + self, + resource_group_name: str, + organization_name: str, + environment_id: str, + cluster_id: str, + body: _models.CreateAPIKeyModel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.APIKeyRecord: + """Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. + + Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :param body: Request payload for get creating API Key for schema registry Cluster ID or Kafka + Cluster ID under a environment. Required. + :type body: ~azure.mgmt.confluent.models.CreateAPIKeyModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_api_key( + self, + resource_group_name: str, + organization_name: str, + environment_id: str, + cluster_id: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.APIKeyRecord: + """Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. + + Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :param body: Request payload for get creating API Key for schema registry Cluster ID or Kafka + Cluster ID under a environment. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_api_key( + self, + resource_group_name: str, + organization_name: str, + environment_id: str, + cluster_id: str, + body: Union[_models.CreateAPIKeyModel, IO], + **kwargs: Any + ) -> _models.APIKeyRecord: + """Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. + + Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :param body: Request payload for get creating API Key for schema registry Cluster ID or Kafka + Cluster ID under a environment. Is either a CreateAPIKeyModel type or a IO type. Required. + :type body: ~azure.mgmt.confluent.models.CreateAPIKeyModel or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.APIKeyRecord] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "CreateAPIKeyModel") + + request = build_create_api_key_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + cluster_id=cluster_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_api_key.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("APIKeyRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_api_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters/{clusterId}/createAPIKey" + } + + @distributed_trace_async + async def delete_cluster_api_key( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, organization_name: str, api_key_id: str, **kwargs: Any + ) -> None: + """Deletes API key of a kafka or schema registry cluster. + + Deletes API key of a kafka or schema registry cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param api_key_id: Confluent API Key id. Required. + :type api_key_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_cluster_api_key_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + api_key_id=api_key_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.delete_cluster_api_key.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_cluster_api_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/apiKeys/{apiKeyId}" + } + + @distributed_trace_async + async def get_cluster_api_key( + self, resource_group_name: str, organization_name: str, api_key_id: str, **kwargs: Any + ) -> _models.APIKeyRecord: + """Get API key details of a kafka or schema registry cluster. + + Get API key details of a kafka or schema registry cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param api_key_id: Confluent API Key id. Required. + :type api_key_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.APIKeyRecord] = kwargs.pop("cls", None) + + request = build_get_cluster_api_key_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + api_key_id=api_key_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_cluster_api_key.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("APIKeyRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_cluster_api_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/apiKeys/{apiKeyId}" + } + + @distributed_trace_async + async def get_schema_registry_cluster_by_id( + self, resource_group_name: str, organization_name: str, environment_id: str, cluster_id: str, **kwargs: Any + ) -> _models.SchemaRegistryClusterRecord: + """Get schema registry cluster by Id. + + Get schema registry cluster by Id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SchemaRegistryClusterRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.SchemaRegistryClusterRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SchemaRegistryClusterRecord] = kwargs.pop("cls", None) + + request = build_get_schema_registry_cluster_by_id_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + cluster_id=cluster_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_schema_registry_cluster_by_id.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SchemaRegistryClusterRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_schema_registry_cluster_by_id.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/schemaRegistryClusters/{clusterId}" + } + + @distributed_trace_async + async def get_cluster_by_id( + self, resource_group_name: str, organization_name: str, environment_id: str, cluster_id: str, **kwargs: Any + ) -> _models.SCClusterRecord: + """Get cluster by Id. + + Get cluster by Id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SCClusterRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.SCClusterRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SCClusterRecord] = kwargs.pop("cls", None) + + request = build_get_cluster_by_id_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + cluster_id=cluster_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_cluster_by_id.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SCClusterRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_cluster_by_id.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters/{clusterId}" + } diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_validations_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_validations_operations.py index dca330cb9fcd..10d0566e8b06 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_validations_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_validations_operations.py @@ -68,8 +68,7 @@ async def validate_organization( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -98,8 +97,7 @@ async def validate_organization( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -126,8 +124,7 @@ async def validate_organization( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -219,8 +216,7 @@ async def validate_organization_v2( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -249,8 +245,7 @@ async def validate_organization_v2( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -277,8 +272,7 @@ async def validate_organization_v2( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/__init__.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/__init__.py index 3c9858ea157e..b64b67350434 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/__init__.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/__init__.py @@ -6,6 +6,11 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +from ._models_py3 import APIKeyOwnerEntity +from ._models_py3 import APIKeyRecord +from ._models_py3 import APIKeyResourceEntity +from ._models_py3 import APIKeySpecEntity +from ._models_py3 import AccessCreateRoleBindingRequestModel from ._models_py3 import AccessInviteUserAccountModel from ._models_py3 import AccessInvitedUserDetails from ._models_py3 import AccessListClusterSuccessResponse @@ -14,6 +19,7 @@ from ._models_py3 import AccessListRoleBindingsSuccessResponse from ._models_py3 import AccessListServiceAccountsSuccessResponse from ._models_py3 import AccessListUsersSuccessResponse +from ._models_py3 import AccessRoleBindingNameListSuccessResponse from ._models_py3 import ClusterByokEntity from ._models_py3 import ClusterConfigEntity from ._models_py3 import ClusterEnvironmentEntity @@ -24,11 +30,16 @@ from ._models_py3 import ConfluentAgreementResource from ._models_py3 import ConfluentAgreementResourceListResponse from ._models_py3 import ConfluentListMetadata +from ._models_py3 import CreateAPIKeyModel from ._models_py3 import EnvironmentRecord from ._models_py3 import ErrorResponseBody +from ._models_py3 import GetEnvironmentsResponse from ._models_py3 import InvitationRecord from ._models_py3 import LinkOrganization from ._models_py3 import ListAccessRequestModel +from ._models_py3 import ListClustersSuccessResponse +from ._models_py3 import ListRegionsSuccessResponse +from ._models_py3 import ListSchemaRegistryClustersResponse from ._models_py3 import MetadataEntity from ._models_py3 import OfferDetail from ._models_py3 import OperationDisplay @@ -37,8 +48,21 @@ from ._models_py3 import OrganizationResource from ._models_py3 import OrganizationResourceListResult from ._models_py3 import OrganizationResourceUpdate +from ._models_py3 import RegionRecord +from ._models_py3 import RegionSpecEntity from ._models_py3 import ResourceProviderDefaultErrorResponse from ._models_py3 import RoleBindingRecord +from ._models_py3 import SCClusterByokEntity +from ._models_py3 import SCClusterNetworkEnvironmentEntity +from ._models_py3 import SCClusterRecord +from ._models_py3 import SCClusterSpecEntity +from ._models_py3 import SCConfluentListMetadata +from ._models_py3 import SCEnvironmentRecord +from ._models_py3 import SCMetadataEntity +from ._models_py3 import SchemaRegistryClusterEnvironmentRegionEntity +from ._models_py3 import SchemaRegistryClusterRecord +from ._models_py3 import SchemaRegistryClusterSpecEntity +from ._models_py3 import SchemaRegistryClusterStatusEntity from ._models_py3 import ServiceAccountRecord from ._models_py3 import SystemData from ._models_py3 import UserDetail @@ -53,6 +77,11 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ + "APIKeyOwnerEntity", + "APIKeyRecord", + "APIKeyResourceEntity", + "APIKeySpecEntity", + "AccessCreateRoleBindingRequestModel", "AccessInviteUserAccountModel", "AccessInvitedUserDetails", "AccessListClusterSuccessResponse", @@ -61,6 +90,7 @@ "AccessListRoleBindingsSuccessResponse", "AccessListServiceAccountsSuccessResponse", "AccessListUsersSuccessResponse", + "AccessRoleBindingNameListSuccessResponse", "ClusterByokEntity", "ClusterConfigEntity", "ClusterEnvironmentEntity", @@ -71,11 +101,16 @@ "ConfluentAgreementResource", "ConfluentAgreementResourceListResponse", "ConfluentListMetadata", + "CreateAPIKeyModel", "EnvironmentRecord", "ErrorResponseBody", + "GetEnvironmentsResponse", "InvitationRecord", "LinkOrganization", "ListAccessRequestModel", + "ListClustersSuccessResponse", + "ListRegionsSuccessResponse", + "ListSchemaRegistryClustersResponse", "MetadataEntity", "OfferDetail", "OperationDisplay", @@ -84,8 +119,21 @@ "OrganizationResource", "OrganizationResourceListResult", "OrganizationResourceUpdate", + "RegionRecord", + "RegionSpecEntity", "ResourceProviderDefaultErrorResponse", "RoleBindingRecord", + "SCClusterByokEntity", + "SCClusterNetworkEnvironmentEntity", + "SCClusterRecord", + "SCClusterSpecEntity", + "SCConfluentListMetadata", + "SCEnvironmentRecord", + "SCMetadataEntity", + "SchemaRegistryClusterEnvironmentRegionEntity", + "SchemaRegistryClusterRecord", + "SchemaRegistryClusterSpecEntity", + "SchemaRegistryClusterStatusEntity", "ServiceAccountRecord", "SystemData", "UserDetail", diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models_py3.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models_py3.py index 76c28b09bdf6..dbb86a7bbe0e 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models_py3.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models_py3.py @@ -17,6 +17,47 @@ from .. import models as _models +class AccessCreateRoleBindingRequestModel(_serialization.Model): + """Create role binding request model. + + :ivar principal: The principal User or Group to bind the role to. + :vartype principal: str + :ivar role_name: The name of the role to bind to the principal. + :vartype role_name: str + :ivar crn_pattern: A CRN that specifies the scope and resource patterns necessary for the role + to bind. + :vartype crn_pattern: str + """ + + _attribute_map = { + "principal": {"key": "principal", "type": "str"}, + "role_name": {"key": "role_name", "type": "str"}, + "crn_pattern": {"key": "crn_pattern", "type": "str"}, + } + + def __init__( + self, + *, + principal: Optional[str] = None, + role_name: Optional[str] = None, + crn_pattern: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword principal: The principal User or Group to bind the role to. + :paramtype principal: str + :keyword role_name: The name of the role to bind to the principal. + :paramtype role_name: str + :keyword crn_pattern: A CRN that specifies the scope and resource patterns necessary for the + role to bind. + :paramtype crn_pattern: str + """ + super().__init__(**kwargs) + self.principal = principal + self.role_name = role_name + self.crn_pattern = crn_pattern + + class AccessInvitedUserDetails(_serialization.Model): """Details of the user being invited. @@ -90,13 +131,13 @@ def __init__( class AccessListClusterSuccessResponse(_serialization.Model): - """List cluster success response. + """Details of the clusters returned on successful response. :ivar kind: Type of response. :vartype kind: str :ivar metadata: Metadata of the list. :vartype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata - :ivar data: Data of the environments list. + :ivar data: List of clusters. :vartype data: list[~azure.mgmt.confluent.models.ClusterRecord] """ @@ -119,7 +160,7 @@ def __init__( :paramtype kind: str :keyword metadata: Metadata of the list. :paramtype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata - :keyword data: Data of the environments list. + :keyword data: List of clusters. :paramtype data: list[~azure.mgmt.confluent.models.ClusterRecord] """ super().__init__(**kwargs) @@ -129,13 +170,13 @@ def __init__( class AccessListEnvironmentsSuccessResponse(_serialization.Model): - """List environments success response. + """Details of the environments returned on successful response. :ivar kind: Type of response. :vartype kind: str - :ivar metadata: Metadata of the list. + :ivar metadata: Metadata of the environment list. :vartype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata - :ivar data: Data of the environments list. + :ivar data: Environment list data. :vartype data: list[~azure.mgmt.confluent.models.EnvironmentRecord] """ @@ -156,9 +197,9 @@ def __init__( """ :keyword kind: Type of response. :paramtype kind: str - :keyword metadata: Metadata of the list. + :keyword metadata: Metadata of the environment list. :paramtype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata - :keyword data: Data of the environments list. + :keyword data: Environment list data. :paramtype data: list[~azure.mgmt.confluent.models.EnvironmentRecord] """ super().__init__(**kwargs) @@ -207,13 +248,13 @@ def __init__( class AccessListRoleBindingsSuccessResponse(_serialization.Model): - """List cluster success response. + """Details of the role bindings returned on successful response. :ivar kind: Type of response. :vartype kind: str :ivar metadata: Metadata of the list. :vartype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata - :ivar data: Data of the environments list. + :ivar data: List of role binding. :vartype data: list[~azure.mgmt.confluent.models.RoleBindingRecord] """ @@ -236,7 +277,7 @@ def __init__( :paramtype kind: str :keyword metadata: Metadata of the list. :paramtype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata - :keyword data: Data of the environments list. + :keyword data: List of role binding. :paramtype data: list[~azure.mgmt.confluent.models.RoleBindingRecord] """ super().__init__(**kwargs) @@ -323,6 +364,243 @@ def __init__( self.data = data +class AccessRoleBindingNameListSuccessResponse(_serialization.Model): + """Details of the role binding names returned on successful response. + + :ivar kind: Type of response. + :vartype kind: str + :ivar metadata: Metadata of the list. + :vartype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata + :ivar data: List of role binding names. + :vartype data: list[str] + """ + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "metadata": {"key": "metadata", "type": "ConfluentListMetadata"}, + "data": {"key": "data", "type": "[str]"}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + metadata: Optional["_models.ConfluentListMetadata"] = None, + data: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword kind: Type of response. + :paramtype kind: str + :keyword metadata: Metadata of the list. + :paramtype metadata: ~azure.mgmt.confluent.models.ConfluentListMetadata + :keyword data: List of role binding names. + :paramtype data: list[str] + """ + super().__init__(**kwargs) + self.kind = kind + self.metadata = metadata + self.data = data + + +class APIKeyOwnerEntity(_serialization.Model): + """API Key Owner details which can be a user or service account. + + :ivar id: API Key owner id. + :vartype id: str + :ivar related: API URL for accessing or modifying the referred object. + :vartype related: str + :ivar resource_name: CRN reference to the referred resource. + :vartype resource_name: str + :ivar kind: Type of the owner service or user account. + :vartype kind: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "related": {"key": "related", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + related: Optional[str] = None, + resource_name: Optional[str] = None, + kind: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: API Key owner id. + :paramtype id: str + :keyword related: API URL for accessing or modifying the referred object. + :paramtype related: str + :keyword resource_name: CRN reference to the referred resource. + :paramtype resource_name: str + :keyword kind: Type of the owner service or user account. + :paramtype kind: str + """ + super().__init__(**kwargs) + self.id = id + self.related = related + self.resource_name = resource_name + self.kind = kind + + +class APIKeyRecord(_serialization.Model): + """Details API key. + + :ivar kind: Type of api key. + :vartype kind: str + :ivar id: Id of the api key. + :vartype id: str + :ivar metadata: Metadata of the record. + :vartype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :ivar spec: Specification of the API Key. + :vartype spec: ~azure.mgmt.confluent.models.APIKeySpecEntity + """ + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "metadata": {"key": "properties.metadata", "type": "SCMetadataEntity"}, + "spec": {"key": "properties.spec", "type": "APIKeySpecEntity"}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + metadata: Optional["_models.SCMetadataEntity"] = None, + spec: Optional["_models.APIKeySpecEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword kind: Type of api key. + :paramtype kind: str + :keyword id: Id of the api key. + :paramtype id: str + :keyword metadata: Metadata of the record. + :paramtype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :keyword spec: Specification of the API Key. + :paramtype spec: ~azure.mgmt.confluent.models.APIKeySpecEntity + """ + super().__init__(**kwargs) + self.kind = kind + self.id = id + self.metadata = metadata + self.spec = spec + + +class APIKeyResourceEntity(_serialization.Model): + """API Key Resource details which can be kafka cluster or schema registry cluster. + + :ivar id: Id of the resource. + :vartype id: str + :ivar environment: The environment of the api key. + :vartype environment: str + :ivar related: API URL for accessing or modifying the api key resource object. + :vartype related: str + :ivar resource_name: CRN reference to the referred resource. + :vartype resource_name: str + :ivar kind: Type of the owner which can be service or user account. + :vartype kind: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "environment": {"key": "environment", "type": "str"}, + "related": {"key": "related", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + environment: Optional[str] = None, + related: Optional[str] = None, + resource_name: Optional[str] = None, + kind: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: Id of the resource. + :paramtype id: str + :keyword environment: The environment of the api key. + :paramtype environment: str + :keyword related: API URL for accessing or modifying the api key resource object. + :paramtype related: str + :keyword resource_name: CRN reference to the referred resource. + :paramtype resource_name: str + :keyword kind: Type of the owner which can be service or user account. + :paramtype kind: str + """ + super().__init__(**kwargs) + self.id = id + self.environment = environment + self.related = related + self.resource_name = resource_name + self.kind = kind + + +class APIKeySpecEntity(_serialization.Model): + """Spec of the API Key record. + + :ivar description: The description of the API Key. + :vartype description: str + :ivar name: The name of the API Key. + :vartype name: str + :ivar secret: API Key Secret. + :vartype secret: str + :ivar resource: Specification of the cluster. + :vartype resource: ~azure.mgmt.confluent.models.APIKeyResourceEntity + :ivar owner: Specification of the cluster. + :vartype owner: ~azure.mgmt.confluent.models.APIKeyOwnerEntity + """ + + _attribute_map = { + "description": {"key": "description", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "secret": {"key": "secret", "type": "str"}, + "resource": {"key": "resource", "type": "APIKeyResourceEntity"}, + "owner": {"key": "owner", "type": "APIKeyOwnerEntity"}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + name: Optional[str] = None, + secret: Optional[str] = None, + resource: Optional["_models.APIKeyResourceEntity"] = None, + owner: Optional["_models.APIKeyOwnerEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword description: The description of the API Key. + :paramtype description: str + :keyword name: The name of the API Key. + :paramtype name: str + :keyword secret: API Key Secret. + :paramtype secret: str + :keyword resource: Specification of the cluster. + :paramtype resource: ~azure.mgmt.confluent.models.APIKeyResourceEntity + :keyword owner: Specification of the cluster. + :paramtype owner: ~azure.mgmt.confluent.models.APIKeyOwnerEntity + """ + super().__init__(**kwargs) + self.description = description + self.name = name + self.secret = secret + self.resource = resource + self.owner = owner + + class ClusterByokEntity(_serialization.Model): """The network associated with this object. @@ -475,15 +753,15 @@ def __init__( class ClusterRecord(_serialization.Model): - """Record of the environment. + """Details of cluster record. - :ivar kind: Type of environment. + :ivar kind: Type of cluster. :vartype kind: str - :ivar id: Id of the environment. + :ivar id: Id of the cluster. :vartype id: str :ivar metadata: Metadata of the record. :vartype metadata: ~azure.mgmt.confluent.models.MetadataEntity - :ivar display_name: Display name of the user. + :ivar display_name: Display name of the cluster. :vartype display_name: str :ivar spec: Specification of the cluster. :vartype spec: ~azure.mgmt.confluent.models.ClusterSpecEntity @@ -512,13 +790,13 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword kind: Type of environment. + :keyword kind: Type of cluster. :paramtype kind: str - :keyword id: Id of the environment. + :keyword id: Id of the cluster. :paramtype id: str :keyword metadata: Metadata of the record. :paramtype metadata: ~azure.mgmt.confluent.models.MetadataEntity - :keyword display_name: Display name of the user. + :keyword display_name: Display name of the cluster. :paramtype display_name: str :keyword spec: Specification of the cluster. :paramtype spec: ~azure.mgmt.confluent.models.ClusterSpecEntity @@ -850,8 +1128,34 @@ def __init__( self.total_size = total_size +class CreateAPIKeyModel(_serialization.Model): + """Create API Key model. + + :ivar name: Name of the API Key. + :vartype name: str + :ivar description: Description of the API Key. + :vartype description: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "description": {"key": "description", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of the API Key. + :paramtype name: str + :keyword description: Description of the API Key. + :paramtype description: str + """ + super().__init__(**kwargs) + self.name = name + self.description = description + + class EnvironmentRecord(_serialization.Model): - """Record of the environment. + """Details about environment name, metadata and environment id of an environment. :ivar kind: Type of environment. :vartype kind: str @@ -934,29 +1238,61 @@ def __init__(self, **kwargs: Any) -> None: self.details = None -class InvitationRecord(_serialization.Model): - """Record of the invitation. +class GetEnvironmentsResponse(_serialization.Model): + """Result of GET request to list Confluent operations. - :ivar kind: Type of account. - :vartype kind: str - :ivar id: Id of the invitation. - :vartype id: str - :ivar metadata: Metadata of the record. - :vartype metadata: ~azure.mgmt.confluent.models.MetadataEntity - :ivar email: Email of the user. - :vartype email: str - :ivar auth_type: Auth type of the user. - :vartype auth_type: str - :ivar status: Status of the invitation. - :vartype status: str - :ivar accepted_at: Accepted date time of the invitation. - :vartype accepted_at: str - :ivar expires_at: Expiration date time of the invitation. - :vartype expires_at: str + :ivar value: List of environments in a confluent organization. + :vartype value: list[~azure.mgmt.confluent.models.SCEnvironmentRecord] + :ivar next_link: URL to get the next set of environment records if there are any. + :vartype next_link: str """ _attribute_map = { - "kind": {"key": "kind", "type": "str"}, + "value": {"key": "value", "type": "[SCEnvironmentRecord]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SCEnvironmentRecord"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of environments in a confluent organization. + :paramtype value: list[~azure.mgmt.confluent.models.SCEnvironmentRecord] + :keyword next_link: URL to get the next set of environment records if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class InvitationRecord(_serialization.Model): + """Record of the invitation. + + :ivar kind: Type of account. + :vartype kind: str + :ivar id: Id of the invitation. + :vartype id: str + :ivar metadata: Metadata of the record. + :vartype metadata: ~azure.mgmt.confluent.models.MetadataEntity + :ivar email: Email of the user. + :vartype email: str + :ivar auth_type: Auth type of the user. + :vartype auth_type: str + :ivar status: Status of the invitation. + :vartype status: str + :ivar accepted_at: Accepted date time of the invitation. + :vartype accepted_at: str + :ivar expires_at: Expiration date time of the invitation. + :vartype expires_at: str + """ + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, "id": {"key": "id", "type": "str"}, "metadata": {"key": "metadata", "type": "MetadataEntity"}, "email": {"key": "email", "type": "str"}, @@ -1054,6 +1390,88 @@ def __init__(self, *, search_filters: Optional[Dict[str, str]] = None, **kwargs: self.search_filters = search_filters +class ListClustersSuccessResponse(_serialization.Model): + """Result of GET request to list clusters in the environment of a confluent organization. + + :ivar value: List of clusters in an environment of a confluent organization. + :vartype value: list[~azure.mgmt.confluent.models.SCClusterRecord] + :ivar next_link: URL to get the next set of cluster records if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SCClusterRecord]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, *, value: Optional[List["_models.SCClusterRecord"]] = None, next_link: Optional[str] = None, **kwargs: Any + ) -> None: + """ + :keyword value: List of clusters in an environment of a confluent organization. + :paramtype value: list[~azure.mgmt.confluent.models.SCClusterRecord] + :keyword next_link: URL to get the next set of cluster records if there are any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ListRegionsSuccessResponse(_serialization.Model): + """Result of POST request to list regions supported by confluent. + + :ivar data: List of regions supported by confluent. + :vartype data: list[~azure.mgmt.confluent.models.RegionRecord] + """ + + _attribute_map = { + "data": {"key": "data", "type": "[RegionRecord]"}, + } + + def __init__(self, *, data: Optional[List["_models.RegionRecord"]] = None, **kwargs: Any) -> None: + """ + :keyword data: List of regions supported by confluent. + :paramtype data: list[~azure.mgmt.confluent.models.RegionRecord] + """ + super().__init__(**kwargs) + self.data = data + + +class ListSchemaRegistryClustersResponse(_serialization.Model): + """Result of GET request to list schema registry clusters in the environment of a confluent + organization. + + :ivar value: List of schema registry clusters in an environment of a confluent organization. + :vartype value: list[~azure.mgmt.confluent.models.SchemaRegistryClusterRecord] + :ivar next_link: URL to get the next set of schema registry cluster records if there are any. + :vartype next_link: str + """ + + _attribute_map = { + "value": {"key": "value", "type": "[SchemaRegistryClusterRecord]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__( + self, + *, + value: Optional[List["_models.SchemaRegistryClusterRecord"]] = None, + next_link: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword value: List of schema registry clusters in an environment of a confluent organization. + :paramtype value: list[~azure.mgmt.confluent.models.SchemaRegistryClusterRecord] + :keyword next_link: URL to get the next set of schema registry cluster records if there are + any. + :paramtype next_link: str + """ + super().__init__(**kwargs) + self.value = value + self.next_link = next_link + + class MetadataEntity(_serialization.Model): """Metadata of the data record. @@ -1473,6 +1891,98 @@ def __init__(self, *, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> N self.tags = tags +class RegionRecord(_serialization.Model): + """Details of region record. + + :ivar kind: Kind of the cluster. + :vartype kind: str + :ivar id: Id of the cluster. + :vartype id: str + :ivar metadata: Metadata of the record. + :vartype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :ivar spec: Specification of the region. + :vartype spec: ~azure.mgmt.confluent.models.RegionSpecEntity + """ + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "metadata": {"key": "properties.metadata", "type": "SCMetadataEntity"}, + "spec": {"key": "properties.spec", "type": "RegionSpecEntity"}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + metadata: Optional["_models.SCMetadataEntity"] = None, + spec: Optional["_models.RegionSpecEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword kind: Kind of the cluster. + :paramtype kind: str + :keyword id: Id of the cluster. + :paramtype id: str + :keyword metadata: Metadata of the record. + :paramtype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :keyword spec: Specification of the region. + :paramtype spec: ~azure.mgmt.confluent.models.RegionSpecEntity + """ + super().__init__(**kwargs) + self.kind = kind + self.id = id + self.metadata = metadata + self.spec = spec + + +class RegionSpecEntity(_serialization.Model): + """Region spec details. + + :ivar name: Display Name of the region. + :vartype name: str + :ivar cloud: Cloud provider name. + :vartype cloud: str + :ivar region_name: Region name. + :vartype region_name: str + :ivar packages: + :vartype packages: list[str] + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "cloud": {"key": "cloud", "type": "str"}, + "region_name": {"key": "regionName", "type": "str"}, + "packages": {"key": "packages", "type": "[str]"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + cloud: Optional[str] = None, + region_name: Optional[str] = None, + packages: Optional[List[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Display Name of the region. + :paramtype name: str + :keyword cloud: Cloud provider name. + :paramtype cloud: str + :keyword region_name: Region name. + :paramtype region_name: str + :keyword packages: + :paramtype packages: list[str] + """ + super().__init__(**kwargs) + self.name = name + self.cloud = cloud + self.region_name = region_name + self.packages = packages + + class ResourceProviderDefaultErrorResponse(_serialization.Model): """Default error response for resource provider. @@ -1497,11 +2007,11 @@ def __init__(self, **kwargs: Any) -> None: class RoleBindingRecord(_serialization.Model): - """Record of the environment. + """Details on principal, role name and crn pattern of a role binding. :ivar kind: The type of the resource. :vartype kind: str - :ivar id: Id of the role. + :ivar id: Id of the role binding. :vartype id: str :ivar metadata: Metadata of the record. :vartype metadata: ~azure.mgmt.confluent.models.MetadataEntity @@ -1537,7 +2047,7 @@ def __init__( """ :keyword kind: The type of the resource. :paramtype kind: str - :keyword id: Id of the role. + :keyword id: Id of the role binding. :paramtype id: str :keyword metadata: Metadata of the record. :paramtype metadata: ~azure.mgmt.confluent.models.MetadataEntity @@ -1558,6 +2068,580 @@ def __init__( self.crn_pattern = crn_pattern +class SCClusterByokEntity(_serialization.Model): + """The network associated with this object. + + :ivar id: ID of the referred resource. + :vartype id: str + :ivar related: API URL for accessing or modifying the referred object. + :vartype related: str + :ivar resource_name: CRN reference to the referred resource. + :vartype resource_name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "related": {"key": "related", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + related: Optional[str] = None, + resource_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: ID of the referred resource. + :paramtype id: str + :keyword related: API URL for accessing or modifying the referred object. + :paramtype related: str + :keyword resource_name: CRN reference to the referred resource. + :paramtype resource_name: str + """ + super().__init__(**kwargs) + self.id = id + self.related = related + self.resource_name = resource_name + + +class SCClusterNetworkEnvironmentEntity(_serialization.Model): + """The environment or the network to which cluster belongs. + + :ivar id: ID of the referred resource. + :vartype id: str + :ivar environment: Environment of the referred resource. + :vartype environment: str + :ivar related: API URL for accessing or modifying the referred object. + :vartype related: str + :ivar resource_name: CRN reference to the referred resource. + :vartype resource_name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "environment": {"key": "environment", "type": "str"}, + "related": {"key": "related", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + environment: Optional[str] = None, + related: Optional[str] = None, + resource_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: ID of the referred resource. + :paramtype id: str + :keyword environment: Environment of the referred resource. + :paramtype environment: str + :keyword related: API URL for accessing or modifying the referred object. + :paramtype related: str + :keyword resource_name: CRN reference to the referred resource. + :paramtype resource_name: str + """ + super().__init__(**kwargs) + self.id = id + self.environment = environment + self.related = related + self.resource_name = resource_name + + +class SCClusterRecord(_serialization.Model): + """Details of cluster record. + + :ivar kind: Type of cluster. + :vartype kind: str + :ivar id: Id of the cluster. + :vartype id: str + :ivar name: Display name of the cluster. + :vartype name: str + :ivar metadata: Metadata of the record. + :vartype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :ivar spec: Specification of the cluster. + :vartype spec: ~azure.mgmt.confluent.models.SCClusterSpecEntity + :ivar status: Specification of the cluster status. + :vartype status: ~azure.mgmt.confluent.models.ClusterStatusEntity + """ + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "metadata": {"key": "properties.metadata", "type": "SCMetadataEntity"}, + "spec": {"key": "properties.spec", "type": "SCClusterSpecEntity"}, + "status": {"key": "properties.status", "type": "ClusterStatusEntity"}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + metadata: Optional["_models.SCMetadataEntity"] = None, + spec: Optional["_models.SCClusterSpecEntity"] = None, + status: Optional["_models.ClusterStatusEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword kind: Type of cluster. + :paramtype kind: str + :keyword id: Id of the cluster. + :paramtype id: str + :keyword name: Display name of the cluster. + :paramtype name: str + :keyword metadata: Metadata of the record. + :paramtype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :keyword spec: Specification of the cluster. + :paramtype spec: ~azure.mgmt.confluent.models.SCClusterSpecEntity + :keyword status: Specification of the cluster status. + :paramtype status: ~azure.mgmt.confluent.models.ClusterStatusEntity + """ + super().__init__(**kwargs) + self.kind = kind + self.id = id + self.name = name + self.metadata = metadata + self.spec = spec + self.status = status + + +class SCClusterSpecEntity(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Spec of the cluster record. + + :ivar name: The name of the cluster. + :vartype name: str + :ivar availability: The availability zone configuration of the cluster. + :vartype availability: str + :ivar cloud: The cloud service provider. + :vartype cloud: str + :ivar zone: type of zone availability. + :vartype zone: str + :ivar region: The cloud service provider region. + :vartype region: str + :ivar kafka_bootstrap_endpoint: The bootstrap endpoint used by Kafka clients to connect to the + cluster. + :vartype kafka_bootstrap_endpoint: str + :ivar http_endpoint: The cluster HTTP request URL. + :vartype http_endpoint: str + :ivar api_endpoint: The Kafka API cluster endpoint. + :vartype api_endpoint: str + :ivar config: Specification of the cluster configuration. + :vartype config: ~azure.mgmt.confluent.models.ClusterConfigEntity + :ivar environment: Specification of the cluster environment. + :vartype environment: ~azure.mgmt.confluent.models.SCClusterNetworkEnvironmentEntity + :ivar network: Specification of the cluster network. + :vartype network: ~azure.mgmt.confluent.models.SCClusterNetworkEnvironmentEntity + :ivar byok: Specification of the cluster byok. + :vartype byok: ~azure.mgmt.confluent.models.SCClusterByokEntity + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "availability": {"key": "availability", "type": "str"}, + "cloud": {"key": "cloud", "type": "str"}, + "zone": {"key": "zone", "type": "str"}, + "region": {"key": "region", "type": "str"}, + "kafka_bootstrap_endpoint": {"key": "kafkaBootstrapEndpoint", "type": "str"}, + "http_endpoint": {"key": "httpEndpoint", "type": "str"}, + "api_endpoint": {"key": "apiEndpoint", "type": "str"}, + "config": {"key": "config", "type": "ClusterConfigEntity"}, + "environment": {"key": "environment", "type": "SCClusterNetworkEnvironmentEntity"}, + "network": {"key": "network", "type": "SCClusterNetworkEnvironmentEntity"}, + "byok": {"key": "byok", "type": "SCClusterByokEntity"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + availability: Optional[str] = None, + cloud: Optional[str] = None, + zone: Optional[str] = None, + region: Optional[str] = None, + kafka_bootstrap_endpoint: Optional[str] = None, + http_endpoint: Optional[str] = None, + api_endpoint: Optional[str] = None, + config: Optional["_models.ClusterConfigEntity"] = None, + environment: Optional["_models.SCClusterNetworkEnvironmentEntity"] = None, + network: Optional["_models.SCClusterNetworkEnvironmentEntity"] = None, + byok: Optional["_models.SCClusterByokEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: The name of the cluster. + :paramtype name: str + :keyword availability: The availability zone configuration of the cluster. + :paramtype availability: str + :keyword cloud: The cloud service provider. + :paramtype cloud: str + :keyword zone: type of zone availability. + :paramtype zone: str + :keyword region: The cloud service provider region. + :paramtype region: str + :keyword kafka_bootstrap_endpoint: The bootstrap endpoint used by Kafka clients to connect to + the cluster. + :paramtype kafka_bootstrap_endpoint: str + :keyword http_endpoint: The cluster HTTP request URL. + :paramtype http_endpoint: str + :keyword api_endpoint: The Kafka API cluster endpoint. + :paramtype api_endpoint: str + :keyword config: Specification of the cluster configuration. + :paramtype config: ~azure.mgmt.confluent.models.ClusterConfigEntity + :keyword environment: Specification of the cluster environment. + :paramtype environment: ~azure.mgmt.confluent.models.SCClusterNetworkEnvironmentEntity + :keyword network: Specification of the cluster network. + :paramtype network: ~azure.mgmt.confluent.models.SCClusterNetworkEnvironmentEntity + :keyword byok: Specification of the cluster byok. + :paramtype byok: ~azure.mgmt.confluent.models.SCClusterByokEntity + """ + super().__init__(**kwargs) + self.name = name + self.availability = availability + self.cloud = cloud + self.zone = zone + self.region = region + self.kafka_bootstrap_endpoint = kafka_bootstrap_endpoint + self.http_endpoint = http_endpoint + self.api_endpoint = api_endpoint + self.config = config + self.environment = environment + self.network = network + self.byok = byok + + +class SCConfluentListMetadata(_serialization.Model): + """Metadata of the list. + + :ivar first: First page of the list. + :vartype first: str + :ivar last: Last page of the list. + :vartype last: str + :ivar prev: Previous page of the list. + :vartype prev: str + :ivar next: Next page of the list. + :vartype next: str + :ivar total_size: Total size of the list. + :vartype total_size: int + """ + + _attribute_map = { + "first": {"key": "first", "type": "str"}, + "last": {"key": "last", "type": "str"}, + "prev": {"key": "prev", "type": "str"}, + "next": {"key": "next", "type": "str"}, + "total_size": {"key": "totalSize", "type": "int"}, + } + + def __init__( + self, + *, + first: Optional[str] = None, + last: Optional[str] = None, + prev: Optional[str] = None, + next: Optional[str] = None, + total_size: Optional[int] = None, + **kwargs: Any + ) -> None: + """ + :keyword first: First page of the list. + :paramtype first: str + :keyword last: Last page of the list. + :paramtype last: str + :keyword prev: Previous page of the list. + :paramtype prev: str + :keyword next: Next page of the list. + :paramtype next: str + :keyword total_size: Total size of the list. + :paramtype total_size: int + """ + super().__init__(**kwargs) + self.first = first + self.last = last + self.prev = prev + self.next = next + self.total_size = total_size + + +class SCEnvironmentRecord(_serialization.Model): + """Details about environment name, metadata and environment id of an environment. + + :ivar kind: Type of environment. + :vartype kind: str + :ivar id: Id of the environment. + :vartype id: str + :ivar name: Display name of the environment. + :vartype name: str + :ivar metadata: Metadata of the record. + :vartype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + """ + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "metadata": {"key": "properties.metadata", "type": "SCMetadataEntity"}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + name: Optional[str] = None, + metadata: Optional["_models.SCMetadataEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword kind: Type of environment. + :paramtype kind: str + :keyword id: Id of the environment. + :paramtype id: str + :keyword name: Display name of the environment. + :paramtype name: str + :keyword metadata: Metadata of the record. + :paramtype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + """ + super().__init__(**kwargs) + self.kind = kind + self.id = id + self.name = name + self.metadata = metadata + + +class SchemaRegistryClusterEnvironmentRegionEntity(_serialization.Model): + """The environment associated with this object. + + :ivar id: ID of the referred resource. + :vartype id: str + :ivar related: API URL for accessing or modifying the referred object. + :vartype related: str + :ivar resource_name: CRN reference to the referred resource. + :vartype resource_name: str + """ + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "related": {"key": "related", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + } + + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + related: Optional[str] = None, + resource_name: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: ID of the referred resource. + :paramtype id: str + :keyword related: API URL for accessing or modifying the referred object. + :paramtype related: str + :keyword resource_name: CRN reference to the referred resource. + :paramtype resource_name: str + """ + super().__init__(**kwargs) + self.id = id + self.related = related + self.resource_name = resource_name + + +class SchemaRegistryClusterRecord(_serialization.Model): + """Details of schema registry cluster record. + + :ivar kind: Kind of the cluster. + :vartype kind: str + :ivar id: Id of the cluster. + :vartype id: str + :ivar metadata: Metadata of the record. + :vartype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :ivar spec: Specification of the schema registry cluster. + :vartype spec: ~azure.mgmt.confluent.models.SchemaRegistryClusterSpecEntity + :ivar status: Specification of the cluster status. + :vartype status: ~azure.mgmt.confluent.models.SchemaRegistryClusterStatusEntity + """ + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "metadata": {"key": "properties.metadata", "type": "SCMetadataEntity"}, + "spec": {"key": "properties.spec", "type": "SchemaRegistryClusterSpecEntity"}, + "status": {"key": "properties.status", "type": "SchemaRegistryClusterStatusEntity"}, + } + + def __init__( + self, + *, + kind: Optional[str] = None, + id: Optional[str] = None, # pylint: disable=redefined-builtin + metadata: Optional["_models.SCMetadataEntity"] = None, + spec: Optional["_models.SchemaRegistryClusterSpecEntity"] = None, + status: Optional["_models.SchemaRegistryClusterStatusEntity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword kind: Kind of the cluster. + :paramtype kind: str + :keyword id: Id of the cluster. + :paramtype id: str + :keyword metadata: Metadata of the record. + :paramtype metadata: ~azure.mgmt.confluent.models.SCMetadataEntity + :keyword spec: Specification of the schema registry cluster. + :paramtype spec: ~azure.mgmt.confluent.models.SchemaRegistryClusterSpecEntity + :keyword status: Specification of the cluster status. + :paramtype status: ~azure.mgmt.confluent.models.SchemaRegistryClusterStatusEntity + """ + super().__init__(**kwargs) + self.kind = kind + self.id = id + self.metadata = metadata + self.spec = spec + self.status = status + + +class SchemaRegistryClusterSpecEntity(_serialization.Model): + """Details of schema registry cluster spec. + + :ivar name: Name of the schema registry cluster. + :vartype name: str + :ivar http_endpoint: Http endpoint of the cluster. + :vartype http_endpoint: str + :ivar package: Type of the cluster package Advanced, essentials. + :vartype package: str + :ivar region: Region details of the schema registry cluster. + :vartype region: ~azure.mgmt.confluent.models.SchemaRegistryClusterEnvironmentRegionEntity + :ivar environment: Environment details of the schema registry cluster. + :vartype environment: ~azure.mgmt.confluent.models.SchemaRegistryClusterEnvironmentRegionEntity + :ivar cloud: The cloud service provider. + :vartype cloud: str + """ + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "http_endpoint": {"key": "httpEndpoint", "type": "str"}, + "package": {"key": "package", "type": "str"}, + "region": {"key": "region", "type": "SchemaRegistryClusterEnvironmentRegionEntity"}, + "environment": {"key": "environment", "type": "SchemaRegistryClusterEnvironmentRegionEntity"}, + "cloud": {"key": "cloud", "type": "str"}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + http_endpoint: Optional[str] = None, + package: Optional[str] = None, + region: Optional["_models.SchemaRegistryClusterEnvironmentRegionEntity"] = None, + environment: Optional["_models.SchemaRegistryClusterEnvironmentRegionEntity"] = None, + cloud: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: Name of the schema registry cluster. + :paramtype name: str + :keyword http_endpoint: Http endpoint of the cluster. + :paramtype http_endpoint: str + :keyword package: Type of the cluster package Advanced, essentials. + :paramtype package: str + :keyword region: Region details of the schema registry cluster. + :paramtype region: ~azure.mgmt.confluent.models.SchemaRegistryClusterEnvironmentRegionEntity + :keyword environment: Environment details of the schema registry cluster. + :paramtype environment: + ~azure.mgmt.confluent.models.SchemaRegistryClusterEnvironmentRegionEntity + :keyword cloud: The cloud service provider. + :paramtype cloud: str + """ + super().__init__(**kwargs) + self.name = name + self.http_endpoint = http_endpoint + self.package = package + self.region = region + self.environment = environment + self.cloud = cloud + + +class SchemaRegistryClusterStatusEntity(_serialization.Model): + """Status of the schema registry cluster record. + + :ivar phase: The lifecycle phase of the cluster. + :vartype phase: str + """ + + _attribute_map = { + "phase": {"key": "phase", "type": "str"}, + } + + def __init__(self, *, phase: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword phase: The lifecycle phase of the cluster. + :paramtype phase: str + """ + super().__init__(**kwargs) + self.phase = phase + + +class SCMetadataEntity(_serialization.Model): + """Metadata of the data record. + + :ivar self_property: Self lookup url. + :vartype self_property: str + :ivar resource_name: Resource name of the record. + :vartype resource_name: str + :ivar created_timestamp: Created Date Time. + :vartype created_timestamp: str + :ivar updated_timestamp: Updated Date time. + :vartype updated_timestamp: str + :ivar deleted_timestamp: Deleted Date time. + :vartype deleted_timestamp: str + """ + + _attribute_map = { + "self_property": {"key": "self", "type": "str"}, + "resource_name": {"key": "resourceName", "type": "str"}, + "created_timestamp": {"key": "createdTimestamp", "type": "str"}, + "updated_timestamp": {"key": "updatedTimestamp", "type": "str"}, + "deleted_timestamp": {"key": "deletedTimestamp", "type": "str"}, + } + + def __init__( + self, + *, + self_property: Optional[str] = None, + resource_name: Optional[str] = None, + created_timestamp: Optional[str] = None, + updated_timestamp: Optional[str] = None, + deleted_timestamp: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword self_property: Self lookup url. + :paramtype self_property: str + :keyword resource_name: Resource name of the record. + :paramtype resource_name: str + :keyword created_timestamp: Created Date Time. + :paramtype created_timestamp: str + :keyword updated_timestamp: Updated Date time. + :paramtype updated_timestamp: str + :keyword deleted_timestamp: Deleted Date time. + :paramtype deleted_timestamp: str + """ + super().__init__(**kwargs) + self.self_property = self_property + self.resource_name = resource_name + self.created_timestamp = created_timestamp + self.updated_timestamp = updated_timestamp + self.deleted_timestamp = deleted_timestamp + + class ServiceAccountRecord(_serialization.Model): """Record of the service account. diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_access_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_access_operations.py index 8bd42989583f..42816639d337 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_access_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_access_operations.py @@ -41,7 +41,7 @@ def build_list_users_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -52,9 +52,7 @@ def build_list_users_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -77,7 +75,7 @@ def build_list_service_accounts_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -88,9 +86,7 @@ def build_list_service_accounts_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -113,7 +109,7 @@ def build_list_invitations_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -124,9 +120,7 @@ def build_list_invitations_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -149,7 +143,7 @@ def build_invite_user_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -160,9 +154,7 @@ def build_invite_user_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -185,7 +177,7 @@ def build_list_environments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -221,7 +213,7 @@ def build_list_clusters_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -257,7 +249,7 @@ def build_list_role_bindings_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -287,6 +279,112 @@ def build_list_role_bindings_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) +def build_create_role_binding_request( + resource_group_name: str, organization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/createRoleBinding", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_role_binding_request( + resource_group_name: str, organization_name: str, role_binding_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/deleteRoleBinding/{roleBindingId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "roleBindingId": _SERIALIZER.url("role_binding_id", role_binding_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_role_binding_name_list_request( + resource_group_name: str, organization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/listRoleBindingNameList", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + class AccessOperations: """ .. warning:: @@ -320,8 +418,7 @@ def list_users( Organization users details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -350,8 +447,7 @@ def list_users( Organization users details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -378,8 +474,7 @@ def list_users( Organization users details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -471,8 +566,7 @@ def list_service_accounts( Organization service accounts details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -501,8 +595,7 @@ def list_service_accounts( Organization service accounts details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -529,8 +622,7 @@ def list_service_accounts( Organization service accounts details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -622,8 +714,7 @@ def list_invitations( Organization accounts invitation details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -652,8 +743,7 @@ def list_invitations( Organization accounts invitation details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -680,8 +770,7 @@ def list_invitations( Organization accounts invitation details. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -773,8 +862,7 @@ def invite_user( Invite user to the organization. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -803,8 +891,7 @@ def invite_user( Invite user to the organization. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -831,8 +918,7 @@ def invite_user( Invite user to the organization. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -1362,3 +1448,373 @@ def list_role_bindings( list_role_bindings.metadata = { "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/listRoleBindings" } + + @overload + def create_role_binding( + self, + resource_group_name: str, + organization_name: str, + body: _models.AccessCreateRoleBindingRequestModel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RoleBindingRecord: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Create role binding Request Model. Required. + :type body: ~azure.mgmt.confluent.models.AccessCreateRoleBindingRequestModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RoleBindingRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.RoleBindingRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_role_binding( + self, + resource_group_name: str, + organization_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RoleBindingRecord: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Create role binding Request Model. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RoleBindingRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.RoleBindingRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_role_binding( + self, + resource_group_name: str, + organization_name: str, + body: Union[_models.AccessCreateRoleBindingRequestModel, IO], + **kwargs: Any + ) -> _models.RoleBindingRecord: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Create role binding Request Model. Is either a AccessCreateRoleBindingRequestModel + type or a IO type. Required. + :type body: ~azure.mgmt.confluent.models.AccessCreateRoleBindingRequestModel or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: RoleBindingRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.RoleBindingRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RoleBindingRecord] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "AccessCreateRoleBindingRequestModel") + + request = build_create_role_binding_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.create_role_binding.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("RoleBindingRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_role_binding.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/createRoleBinding" + } + + @distributed_trace + def delete_role_binding( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, organization_name: str, role_binding_id: str, **kwargs: Any + ) -> None: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param role_binding_id: Confluent Role binding id. Required. + :type role_binding_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_role_binding_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + role_binding_id=role_binding_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.delete_role_binding.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_role_binding.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/deleteRoleBinding/{roleBindingId}" + } + + @overload + def list_role_binding_name_list( + self, + resource_group_name: str, + organization_name: str, + body: _models.ListAccessRequestModel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AccessRoleBindingNameListSuccessResponse: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessRoleBindingNameListSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.AccessRoleBindingNameListSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def list_role_binding_name_list( + self, + resource_group_name: str, + organization_name: str, + body: IO, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.AccessRoleBindingNameListSuccessResponse: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Required. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessRoleBindingNameListSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.AccessRoleBindingNameListSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def list_role_binding_name_list( + self, + resource_group_name: str, + organization_name: str, + body: Union[_models.ListAccessRequestModel, IO], + **kwargs: Any + ) -> _models.AccessRoleBindingNameListSuccessResponse: + """Organization role bindings. + + Organization role bindings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: List Access Request Model. Is either a ListAccessRequestModel type or a IO type. + Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessRoleBindingNameListSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.AccessRoleBindingNameListSuccessResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.AccessRoleBindingNameListSuccessResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + _json = self._serialize.body(body, "ListAccessRequestModel") + + request = build_list_role_binding_name_list_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_role_binding_name_list.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("AccessRoleBindingNameListSuccessResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_role_binding_name_list.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/access/default/listRoleBindingNameList" + } diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_marketplace_agreements_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_marketplace_agreements_operations.py index 73e3c96ce196..79f537589988 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_marketplace_agreements_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_marketplace_agreements_operations.py @@ -41,7 +41,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,7 +65,7 @@ def build_create_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations.py index 32eb4ff2eff3..8c7ef6640423 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations.py @@ -43,7 +43,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,9 +77,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -99,7 +97,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,9 +107,7 @@ def build_get_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -132,7 +128,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +139,7 @@ def build_create_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -168,7 +162,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -179,9 +173,7 @@ def build_update_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -204,7 +196,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -214,9 +206,7 @@ def build_delete_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -231,196 +221,1267 @@ def build_delete_request( return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -class OrganizationOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. +def build_list_environments_request( + resource_group_name: str, + organization_name: str, + subscription_id: str, + *, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - Instead, you should access the following operations through - :class:`~azure.mgmt.confluent.ConfluentManagementClient`'s - :attr:`organization` attribute. - """ + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") - models = _models + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + } - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + _url: str = _url.format(**path_format_arguments) # type: ignore - @distributed_trace - def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.OrganizationResource"]: - """List all organizations under the specified subscription. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if page_token is not None: + _params["pageToken"] = _SERIALIZER.query("page_token", page_token, "str") - List all organizations under the specified subscription. + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrganizationResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.OrganizationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrganizationResourceListResult] = kwargs.pop("cls", None) - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) +def build_get_environment_by_id_request( + resource_group_name: str, organization_name: str, environment_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") - request = build_list_by_subscription_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_subscription.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "environmentId": _SERIALIZER.url("environment_id", environment_id, "str"), + } - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + _url: str = _url.format(**path_format_arguments) # type: ignore - def extract_data(pipeline_response): - deserialized = self._deserialize("OrganizationResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - def get_next(next_link=None): - request = prepare_request(next_link) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ResourceProviderDefaultErrorResponse, pipeline_response - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - return pipeline_response +def build_list_clusters_request( + resource_group_name: str, + organization_name: str, + environment_id: str, + subscription_id: str, + *, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - return ItemPaged(get_next, extract_data) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") - list_by_subscription.metadata = { - "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations" + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "environmentId": _SERIALIZER.url("environment_id", environment_id, "str"), } - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.OrganizationResource"]: - """List all Organizations under the specified resource group. + _url: str = _url.format(**path_format_arguments) # type: ignore - List all Organizations under the specified resource group. + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if page_token is not None: + _params["pageToken"] = _SERIALIZER.query("page_token", page_token, "str") - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either OrganizationResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.OrganizationResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrganizationResourceListResult] = kwargs.pop("cls", None) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - error_map = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: +def build_list_schema_registry_clusters_request( + resource_group_name: str, + organization_name: str, + environment_id: str, + subscription_id: str, + *, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - template_url=self.list_by_resource_group.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) - request.method = "GET" - return request + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/schemaRegistryClusters", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "environmentId": _SERIALIZER.url("environment_id", environment_id, "str"), + } - def extract_data(pipeline_response): - deserialized = self._deserialize("OrganizationResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + _url: str = _url.format(**path_format_arguments) # type: ignore - def get_next(next_link=None): - request = prepare_request(next_link) + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if page_size is not None: + _params["pageSize"] = _SERIALIZER.query("page_size", page_size, "int") + if page_token is not None: + _params["pageToken"] = _SERIALIZER.query("page_token", page_token, "str") - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ResourceProviderDefaultErrorResponse, pipeline_response + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_regions_request( + resource_group_name: str, organization_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/listRegions", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_create_api_key_request( + resource_group_name: str, + organization_name: str, + environment_id: str, + cluster_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters/{clusterId}/createAPIKey", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "environmentId": _SERIALIZER.url("environment_id", environment_id, "str"), + "clusterId": _SERIALIZER.url("cluster_id", cluster_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_delete_cluster_api_key_request( + resource_group_name: str, organization_name: str, api_key_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/apiKeys/{apiKeyId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "apiKeyId": _SERIALIZER.url("api_key_id", api_key_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_cluster_api_key_request( + resource_group_name: str, organization_name: str, api_key_id: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/apiKeys/{apiKeyId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "apiKeyId": _SERIALIZER.url("api_key_id", api_key_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_schema_registry_cluster_by_id_request( + resource_group_name: str, + organization_name: str, + environment_id: str, + cluster_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/schemaRegistryClusters/{clusterId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "environmentId": _SERIALIZER.url("environment_id", environment_id, "str"), + "clusterId": _SERIALIZER.url("cluster_id", cluster_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_get_cluster_by_id_request( + resource_group_name: str, + organization_name: str, + environment_id: str, + cluster_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters/{clusterId}", + ) # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url( + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 + ), + "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), + "environmentId": _SERIALIZER.url("environment_id", environment_id, "str"), + "clusterId": _SERIALIZER.url("cluster_id", cluster_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +class OrganizationOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.confluent.ConfluentManagementClient`'s + :attr:`organization` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_subscription(self, **kwargs: Any) -> Iterable["_models.OrganizationResource"]: + """List all organizations under the specified subscription. + + List all organizations under the specified subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrganizationResource or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.OrganizationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OrganizationResourceListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_subscription_request( + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_subscription.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OrganizationResourceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_subscription.metadata = { + "url": "/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations" + } + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> Iterable["_models.OrganizationResource"]: + """List all Organizations under the specified resource group. + + List all Organizations under the specified resource group. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either OrganizationResource or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.OrganizationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OrganizationResourceListResult] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.list_by_resource_group.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OrganizationResourceListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + list_by_resource_group.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations" + } + + @distributed_trace + def get(self, resource_group_name: str, organization_name: str, **kwargs: Any) -> _models.OrganizationResource: + """Get the properties of a specific Organization resource. + + Get the properties of a specific Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrganizationResource or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) + + request = build_get_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OrganizationResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + } + + def _create_initial( + self, + resource_group_name: str, + organization_name: str, + body: Optional[Union[_models.OrganizationResource, IO]] = None, + **kwargs: Any + ) -> _models.OrganizationResource: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "OrganizationResource") + else: + _json = None + + request = build_create_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self._create_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize("OrganizationResource", pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize("OrganizationResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + _create_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + } + + @overload + def begin_create( + self, + resource_group_name: str, + organization_name: str, + body: Optional[_models.OrganizationResource] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrganizationResource]: + """Create Organization resource. + + Create Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Organization resource model. Default value is None. + :type body: ~azure.mgmt.confluent.models.OrganizationResource + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OrganizationResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.confluent.models.OrganizationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + organization_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.OrganizationResource]: + """Create Organization resource. + + Create Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Organization resource model. Default value is None. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OrganizationResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.confluent.models.OrganizationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + organization_name: str, + body: Optional[Union[_models.OrganizationResource, IO]] = None, + **kwargs: Any + ) -> LROPoller[_models.OrganizationResource]: + """Create Organization resource. + + Create Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Organization resource model. Is either a OrganizationResource type or a IO type. + Default value is None. + :type body: ~azure.mgmt.confluent.models.OrganizationResource or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either OrganizationResource or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.confluent.models.OrganizationResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._create_initial( + resource_group_name=resource_group_name, + organization_name=organization_name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("OrganizationResource", pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_create.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + } + + @overload + def update( + self, + resource_group_name: str, + organization_name: str, + body: Optional[_models.OrganizationResourceUpdate] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.OrganizationResource: + """Update Organization resource. + + Update Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Updated Organization resource. Default value is None. + :type body: ~azure.mgmt.confluent.models.OrganizationResourceUpdate + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrganizationResource or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + organization_name: str, + body: Optional[IO] = None, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.OrganizationResource: + """Update Organization resource. + + Update Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Updated Organization resource. Default value is None. + :type body: IO + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrganizationResource or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + organization_name: str, + body: Optional[Union[_models.OrganizationResourceUpdate, IO]] = None, + **kwargs: Any + ) -> _models.OrganizationResource: + """Update Organization resource. + + Update Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param body: Updated Organization resource. Is either a OrganizationResourceUpdate type or a IO + type. Default value is None. + :type body: ~azure.mgmt.confluent.models.OrganizationResourceUpdate or IO + :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. + Default value is None. + :paramtype content_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: OrganizationResource or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body + else: + if body is not None: + _json = self._serialize.body(body, "OrganizationResourceUpdate") + else: + _json = None + + request = build_update_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.update.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("OrganizationResource", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + update.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + } + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, organization_name: str, **kwargs: Any + ) -> None: + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + request = build_delete_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self._delete_initial.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_initial.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + } + + @distributed_trace + def begin_delete(self, resource_group_name: str, organization_name: str, **kwargs: Any) -> LROPoller[None]: + """Delete Organization resource. + + Delete Organization resource. + + :param resource_group_name: Resource group name. Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( # type: ignore + resource_group_name=resource_group_name, + organization_name=organization_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + begin_delete.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + } + + @distributed_trace + def list_environments( + self, + resource_group_name: str, + organization_name: str, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.SCEnvironmentRecord"]: + """Lists of all the environments in a organization. + + Lists of all the environments in a organization. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param page_size: Pagination size. Default value is None. + :type page_size: int + :param page_token: An opaque pagination token to fetch the next set of records. Default value + is None. + :type page_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SCEnvironmentRecord or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.SCEnvironmentRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GetEnvironmentsResponse] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_environments_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + page_size=page_size, + page_token=page_token, + api_version=api_version, + template_url=self.list_environments.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GetEnvironmentsResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -428,24 +1489,28 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) - list_by_resource_group.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations" + list_environments.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments" } @distributed_trace - def get(self, resource_group_name: str, organization_name: str, **kwargs: Any) -> _models.OrganizationResource: - """Get the properties of a specific Organization resource. + def get_environment_by_id( + self, resource_group_name: str, organization_name: str, environment_id: str, **kwargs: Any + ) -> _models.SCEnvironmentRecord: + """Get Environment details by environment Id. - Get the properties of a specific Organization resource. + Get Environment details by environment Id. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrganizationResource or the result of cls(response) - :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :return: SCEnvironmentRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.SCEnvironmentRecord :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -460,14 +1525,15 @@ def get(self, resource_group_name: str, organization_name: str, **kwargs: Any) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) + cls: ClsType[_models.SCEnvironmentRecord] = kwargs.pop("cls", None) - request = build_get_request( + request = build_get_environment_by_id_request( resource_group_name=resource_group_name, organization_name=organization_name, + environment_id=environment_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self.get.metadata["url"], + template_url=self.get_environment_by_id.metadata["url"], headers=_headers, params=_params, ) @@ -486,26 +1552,169 @@ def get(self, resource_group_name: str, organization_name: str, **kwargs: Any) - error = self._deserialize.failsafe_deserialize( _models.ResourceProviderDefaultErrorResponse, pipeline_response ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SCEnvironmentRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_environment_by_id.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}" + } + + @distributed_trace + def list_clusters( + self, + resource_group_name: str, + organization_name: str, + environment_id: str, + page_size: Optional[int] = None, + page_token: Optional[str] = None, + **kwargs: Any + ) -> Iterable["_models.SCClusterRecord"]: + """Lists of all the clusters in a environment. + + Lists of all the clusters in a environment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param page_size: Pagination size. Default value is None. + :type page_size: int + :param page_token: An opaque pagination token to fetch the next set of records. Default value + is None. + :type page_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SCClusterRecord or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.SCClusterRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ListClustersSuccessResponse] = kwargs.pop("cls", None) + + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + request = build_list_clusters_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + subscription_id=self._config.subscription_id, + page_size=page_size, + page_token=page_token, + api_version=api_version, + template_url=self.list_clusters.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ListClustersSuccessResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - deserialized = self._deserialize("OrganizationResource", pipeline_response) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) + return pipeline_response - return deserialized + return ItemPaged(get_next, extract_data) - get.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + list_clusters.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters" } - def _create_initial( + @distributed_trace + def list_schema_registry_clusters( self, resource_group_name: str, organization_name: str, - body: Optional[Union[_models.OrganizationResource, IO]] = None, + environment_id: str, + page_size: Optional[int] = None, + page_token: Optional[str] = None, **kwargs: Any - ) -> _models.OrganizationResource: + ) -> Iterable["_models.SchemaRegistryClusterRecord"]: + """Get schema registry clusters. + + Get schema registry clusters. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param page_size: Pagination size. Default value is None. + :type page_size: int + :param page_token: An opaque pagination token to fetch the next set of records. Default value + is None. + :type page_token: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either SchemaRegistryClusterRecord or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.SchemaRegistryClusterRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ListSchemaRegistryClustersResponse] = kwargs.pop("cls", None) + error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -514,316 +1723,330 @@ def _create_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) + request = build_list_schema_registry_clusters_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + subscription_id=self._config.subscription_id, + page_size=page_size, + page_token=page_token, + api_version=api_version, + template_url=self.list_schema_registry_clusters.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = self._serialize.body(body, "OrganizationResource") else: - _json = None - - request = build_create_request( - resource_group_name=resource_group_name, - organization_name=organization_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - template_url=self._create_initial.metadata["url"], - headers=_headers, - params=_params, - ) - request = _convert_request(request) - request.url = self._client.format_url(request.url) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + request.method = "GET" + return request - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = self._deserialize("ListSchemaRegistryClustersResponse", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + request = prepare_request(next_link) - if response.status_code not in [200, 201]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ResourceProviderDefaultErrorResponse, pipeline_response + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - if response.status_code == 200: - deserialized = self._deserialize("OrganizationResource", pipeline_response) + response = pipeline_response.http_response - if response.status_code == 201: - deserialized = self._deserialize("OrganizationResource", pipeline_response) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) - _create_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + list_schema_registry_clusters.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/schemaRegistryClusters" } @overload - def begin_create( + def list_regions( self, resource_group_name: str, organization_name: str, - body: Optional[_models.OrganizationResource] = None, + body: _models.ListAccessRequestModel, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OrganizationResource]: - """Create Organization resource. + ) -> _models.ListRegionsSuccessResponse: + """cloud provider regions available for creating Schema Registry clusters. - Create Organization resource. + cloud provider regions available for creating Schema Registry clusters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str - :param body: Organization resource model. Default value is None. - :type body: ~azure.mgmt.confluent.models.OrganizationResource + :param body: List Access Request Model. Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrganizationResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.confluent.models.OrganizationResource] + :return: ListRegionsSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.ListRegionsSuccessResponse :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create( + def list_regions( self, resource_group_name: str, organization_name: str, - body: Optional[IO] = None, + body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.OrganizationResource]: - """Create Organization resource. + ) -> _models.ListRegionsSuccessResponse: + """cloud provider regions available for creating Schema Registry clusters. - Create Organization resource. + cloud provider regions available for creating Schema Registry clusters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str - :param body: Organization resource model. Default value is None. + :param body: List Access Request Model. Required. :type body: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrganizationResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.confluent.models.OrganizationResource] + :return: ListRegionsSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.ListRegionsSuccessResponse :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create( + def list_regions( self, resource_group_name: str, organization_name: str, - body: Optional[Union[_models.OrganizationResource, IO]] = None, + body: Union[_models.ListAccessRequestModel, IO], **kwargs: Any - ) -> LROPoller[_models.OrganizationResource]: - """Create Organization resource. + ) -> _models.ListRegionsSuccessResponse: + """cloud provider regions available for creating Schema Registry clusters. - Create Organization resource. + cloud provider regions available for creating Schema Registry clusters. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str - :param body: Organization resource model. Is either a OrganizationResource type or a IO type. - Default value is None. - :type body: ~azure.mgmt.confluent.models.OrganizationResource or IO + :param body: List Access Request Model. Is either a ListAccessRequestModel type or a IO type. + Required. + :type body: ~azure.mgmt.confluent.models.ListAccessRequestModel or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either OrganizationResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.confluent.models.OrganizationResource] + :return: ListRegionsSuccessResponse or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.ListRegionsSuccessResponse :raises ~azure.core.exceptions.HttpResponseError: """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - organization_name=organization_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - kwargs.pop("error_map", None) + cls: ClsType[_models.ListRegionsSuccessResponse] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OrganizationResource", pipeline_response) - if cls: - return cls(pipeline_response, deserialized, {}) - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(body, (IOBase, bytes)): + _content = body else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + _json = self._serialize.body(body, "ListAccessRequestModel") + + request = build_list_regions_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + template_url=self.list_regions.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - begin_create.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + deserialized = self._deserialize("ListRegionsSuccessResponse", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + list_regions.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/listRegions" } @overload - def update( + def create_api_key( self, resource_group_name: str, organization_name: str, - body: Optional[_models.OrganizationResourceUpdate] = None, + environment_id: str, + cluster_id: str, + body: _models.CreateAPIKeyModel, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.OrganizationResource: - """Update Organization resource. + ) -> _models.APIKeyRecord: + """Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. - Update Organization resource. + Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str - :param body: Updated Organization resource. Default value is None. - :type body: ~azure.mgmt.confluent.models.OrganizationResourceUpdate + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :param body: Request payload for get creating API Key for schema registry Cluster ID or Kafka + Cluster ID under a environment. Required. + :type body: ~azure.mgmt.confluent.models.CreateAPIKeyModel :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrganizationResource or the result of cls(response) - :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def update( + def create_api_key( self, resource_group_name: str, organization_name: str, - body: Optional[IO] = None, + environment_id: str, + cluster_id: str, + body: IO, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.OrganizationResource: - """Update Organization resource. + ) -> _models.APIKeyRecord: + """Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. - Update Organization resource. + Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str - :param body: Updated Organization resource. Default value is None. + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :param body: Request payload for get creating API Key for schema registry Cluster ID or Kafka + Cluster ID under a environment. Required. :type body: IO :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrganizationResource or the result of cls(response) - :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def update( + def create_api_key( self, resource_group_name: str, organization_name: str, - body: Optional[Union[_models.OrganizationResourceUpdate, IO]] = None, + environment_id: str, + cluster_id: str, + body: Union[_models.CreateAPIKeyModel, IO], **kwargs: Any - ) -> _models.OrganizationResource: - """Update Organization resource. + ) -> _models.APIKeyRecord: + """Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. - Update Organization resource. + Creates API key for a schema registry Cluster ID or Kafka Cluster ID under a environment. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str - :param body: Updated Organization resource. Is either a OrganizationResourceUpdate type or a IO - type. Default value is None. - :type body: ~azure.mgmt.confluent.models.OrganizationResourceUpdate or IO + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :param body: Request payload for get creating API Key for schema registry Cluster ID or Kafka + Cluster ID under a environment. Is either a CreateAPIKeyModel type or a IO type. Required. + :type body: ~azure.mgmt.confluent.models.CreateAPIKeyModel or IO :keyword content_type: Body Parameter content-type. Known values are: 'application/json'. Default value is None. :paramtype content_type: str :keyword callable cls: A custom type or function that will be passed the direct response - :return: OrganizationResource or the result of cls(response) - :rtype: ~azure.mgmt.confluent.models.OrganizationResource + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord :raises ~azure.core.exceptions.HttpResponseError: """ error_map = { @@ -839,7 +2062,7 @@ def update( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.OrganizationResource] = kwargs.pop("cls", None) + cls: ClsType[_models.APIKeyRecord] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -847,20 +2070,19 @@ def update( if isinstance(body, (IOBase, bytes)): _content = body else: - if body is not None: - _json = self._serialize.body(body, "OrganizationResourceUpdate") - else: - _json = None + _json = self._serialize.body(body, "CreateAPIKeyModel") - request = build_update_request( + request = build_create_api_key_request( resource_group_name=resource_group_name, organization_name=organization_name, + environment_id=environment_id, + cluster_id=cluster_id, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, json=_json, content=_content, - template_url=self.update.metadata["url"], + template_url=self.create_api_key.metadata["url"], headers=_headers, params=_params, ) @@ -881,20 +2103,37 @@ def update( ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("OrganizationResource", pipeline_response) + deserialized = self._deserialize("APIKeyRecord", pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - update.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + create_api_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters/{clusterId}/createAPIKey" } - def _delete_initial( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, organization_name: str, **kwargs: Any + @distributed_trace + def delete_cluster_api_key( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, organization_name: str, api_key_id: str, **kwargs: Any ) -> None: + """Deletes API key of a kafka or schema registry cluster. + + Deletes API key of a kafka or schema registry cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param api_key_id: Confluent API Key id. Required. + :type api_key_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -909,12 +2148,13 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) - request = build_delete_request( + request = build_delete_cluster_api_key_request( resource_group_name=resource_group_name, organization_name=organization_name, + api_key_id=api_key_id, subscription_id=self._config.subscription_id, api_version=api_version, - template_url=self._delete_initial.metadata["url"], + template_url=self.delete_cluster_api_key.metadata["url"], headers=_headers, params=_params, ) @@ -928,7 +2168,7 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) error = self._deserialize.failsafe_deserialize( _models.ResourceProviderDefaultErrorResponse, pipeline_response @@ -938,74 +2178,228 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + delete_cluster_api_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/apiKeys/{apiKeyId}" } @distributed_trace - def begin_delete(self, resource_group_name: str, organization_name: str, **kwargs: Any) -> LROPoller[None]: - """Delete Organization resource. + def get_cluster_api_key( + self, resource_group_name: str, organization_name: str, api_key_id: str, **kwargs: Any + ) -> _models.APIKeyRecord: + """Get API key details of a kafka or schema registry cluster. - Delete Organization resource. + Get API key details of a kafka or schema registry cluster. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str + :param api_key_id: Confluent API Key id. Required. + :type api_key_id: str :keyword callable cls: A custom type or function that will be passed the direct response - :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this - operation to not poll, or pass in your own initialized polling object for a personal polling - strategy. - :paramtype polling: bool or ~azure.core.polling.PollingMethod - :keyword int polling_interval: Default waiting time between two polls for LRO operations if no - Retry-After header is present. - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :return: APIKeyRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.APIKeyRecord :raises ~azure.core.exceptions.HttpResponseError: """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( # type: ignore - resource_group_name=resource_group_name, - organization_name=organization_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + cls: ClsType[_models.APIKeyRecord] = kwargs.pop("cls", None) + + request = build_get_cluster_api_key_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + api_key_id=api_key_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_cluster_api_key.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response ) - kwargs.pop("error_map", None) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) + deserialized = self._deserialize("APIKeyRecord", pipeline_response) - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_cluster_api_key.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/apiKeys/{apiKeyId}" + } + + @distributed_trace + def get_schema_registry_cluster_by_id( + self, resource_group_name: str, organization_name: str, environment_id: str, cluster_id: str, **kwargs: Any + ) -> _models.SchemaRegistryClusterRecord: + """Get schema registry cluster by Id. + + Get schema registry cluster by Id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SchemaRegistryClusterRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.SchemaRegistryClusterRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SchemaRegistryClusterRecord] = kwargs.pop("cls", None) + + request = build_get_schema_registry_cluster_by_id_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + cluster_id=cluster_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_schema_registry_cluster_by_id.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller.from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SchemaRegistryClusterRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_schema_registry_cluster_by_id.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/schemaRegistryClusters/{clusterId}" + } + + @distributed_trace + def get_cluster_by_id( + self, resource_group_name: str, organization_name: str, environment_id: str, cluster_id: str, **kwargs: Any + ) -> _models.SCClusterRecord: + """Get cluster by Id. + + Get cluster by Id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param organization_name: Organization resource name. Required. + :type organization_name: str + :param environment_id: Confluent environment id. Required. + :type environment_id: str + :param cluster_id: Confluent kafka or schema registry cluster id. Required. + :type cluster_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SCClusterRecord or the result of cls(response) + :rtype: ~azure.mgmt.confluent.models.SCClusterRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SCClusterRecord] = kwargs.pop("cls", None) + + request = build_get_cluster_by_id_request( + resource_group_name=resource_group_name, + organization_name=organization_name, + environment_id=environment_id, + cluster_id=cluster_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + template_url=self.get_cluster_by_id.metadata["url"], + headers=_headers, + params=_params, + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ResourceProviderDefaultErrorResponse, pipeline_response ) - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) # type: ignore + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - begin_delete.metadata = { - "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}" + deserialized = self._deserialize("SCClusterRecord", pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_cluster_by_id.metadata = { + "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}/environments/{environmentId}/clusters/{clusterId}" } diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations_operations.py index 3930f240e562..19fc8c2e4426 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_organization_operations_operations.py @@ -40,7 +40,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_validations_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_validations_operations.py index 345cad9f4bf7..4531ced014af 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_validations_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_validations_operations.py @@ -41,7 +41,7 @@ def build_validate_organization_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -52,9 +52,7 @@ def build_validate_organization_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -77,7 +75,7 @@ def build_validate_organization_v2_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-08-22")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-02-13")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -88,9 +86,7 @@ def build_validate_organization_v2_request( ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "organizationName": _SERIALIZER.url("organization_name", organization_name, "str"), } @@ -140,8 +136,7 @@ def validate_organization( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -170,8 +165,7 @@ def validate_organization( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -198,8 +192,7 @@ def validate_organization( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -291,8 +284,7 @@ def validate_organization_v2( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -321,8 +313,7 @@ def validate_organization_v2( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str @@ -349,8 +340,7 @@ def validate_organization_v2( Organization Validate proxy resource. - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. + :param resource_group_name: Resource group name. Required. :type resource_group_name: str :param organization_name: Organization resource name. Required. :type organization_name: str diff --git a/sdk/confluent/azure-mgmt-confluent/dev_requirements.txt b/sdk/confluent/azure-mgmt-confluent/dev_requirements.txt index c7c93cfae649..17ac5c35fde1 100644 --- a/sdk/confluent/azure-mgmt-confluent/dev_requirements.txt +++ b/sdk/confluent/azure-mgmt-confluent/dev_requirements.txt @@ -1,2 +1,3 @@ -e ../../../tools/azure-sdk-tools -e ../../../tools/azure-devtools +-e ../../resources/azure-mgmt-resource diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_cluster_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_cluster_list.py index 2a25c2108475..5f1541260d4a 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_cluster_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_cluster_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Access_ClusterList.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_ClusterList.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_create_role_binding.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_create_role_binding.py new file mode 100644 index 000000000000..79c57038ca6e --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_create_role_binding.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python access_create_role_binding.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.access.create_role_binding( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + body={ + "crn_pattern": "crn://confluent.cloud/organization=1111aaaa-11aa-11aa-11aa-111111aaaaaa/environment=env-aaa1111/cloud-cluster=lkc-1111aaa", + "principal": "User:u-111aaa", + "role_name": "CloudClusterAdmin", + }, + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_CreateRoleBinding.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_delete_role_binding.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_delete_role_binding.py new file mode 100644 index 000000000000..e4639fff24de --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_delete_role_binding.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python access_delete_role_binding.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.access.delete_role_binding( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + role_binding_id="dlz-f3a90de", + ) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_DeleteRoleBinding.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_environment_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_environment_list.py index 0fa4ec720a42..42a51c530887 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_environment_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_environment_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Access_EnvironmentList.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_EnvironmentList.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invitations_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invitations_list.py index fa4b1c9d0245..6589ba607ae0 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invitations_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invitations_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Access_InvitationsList.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_InvitationsList.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invite_user.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invite_user.py index 96a8a5cbc1d0..7ed29770e5b3 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invite_user.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_invite_user.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Access_InviteUser.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_InviteUser.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_role_binding_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_role_binding_list.py index 587686e699bd..bda7b9dd51a2 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_role_binding_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_role_binding_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Access_RoleBindingList.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_RoleBindingList.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_role_binding_name_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_role_binding_name_list.py new file mode 100644 index 000000000000..5986fc99c1c7 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_role_binding_name_list.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python access_role_binding_name_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.access.list_role_binding_name_list( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + body={ + "searchFilters": { + "crn_pattern": "crn://confluent.cloud/organization=1aa7de07-298e-479c-8f2f-16ac91fd8e76", + "namespace": "public,dataplane,networking,identity,datagovernance,connect,streamcatalog,pipelines,ksql", + } + }, + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_RoleBindingNameList.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_service_accounts_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_service_accounts_list.py index bf1908cd7882..cbe623c5fcc2 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_service_accounts_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_service_accounts_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Access_ServiceAccountsList.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_ServiceAccountsList.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_users_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_users_list.py index 09a69c584c13..4986072b5bc0 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/access_users_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/access_users_list.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Access_UsersList.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Access_UsersList.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_create.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_create.py index e8ba25142bb4..7687720db074 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_create.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_create.py @@ -33,6 +33,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/MarketplaceAgreements_Create.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/MarketplaceAgreements_Create.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_list.py index 35f3715b8b86..4bb442734625 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/marketplace_agreements_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/MarketplaceAgreements_List.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/MarketplaceAgreements_List.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_cluster_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_cluster_list.py new file mode 100644 index 000000000000..335868e8c795 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_cluster_list.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_cluster_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.list_clusters( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + environment_id="env-12132", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_ClusterList.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_create.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_create.py index c58b3f59f1cc..1b2ff8bb18a9 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_create.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_create.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Organization_Create.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_Create.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_create_cluster_api_key.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_create_cluster_api_key.py new file mode 100644 index 000000000000..a4b98d7b2fc3 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_create_cluster_api_key.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_create_cluster_api_key.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.create_api_key( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + environment_id="env-12132", + cluster_id="clusterId-123", + body={"description": "This API key provides kafka access to cluster x", "name": "CI kafka access key"}, + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_CreateClusterAPIKey.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_delete.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_delete.py index 4b9a3604ef49..5133b5b604ca 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_delete.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_delete.py @@ -35,6 +35,6 @@ def main(): ).result() -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Organization_Delete.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_Delete.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_delete_cluster_api_key.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_delete_cluster_api_key.py new file mode 100644 index 000000000000..3f54966b71a7 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_delete_cluster_api_key.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_delete_cluster_api_key.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + client.organization.delete_cluster_api_key( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + api_key_id="ZFZ6SZZZWGYBEIFB", + ) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_DeleteClusterAPIKey.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_environment_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_environment_list.py new file mode 100644 index 000000000000..607c74ede352 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_environment_list.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_environment_list.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.list_environments( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_EnvironmentList.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get.py index 09e5e4134c84..18c5f0ff5d4f 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Organization_Get.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_Get.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_cluster_api_key.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_cluster_api_key.py new file mode 100644 index 000000000000..5c37a05ee94c --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_cluster_api_key.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_get_cluster_api_key.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.get_cluster_api_key( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + api_key_id="apiKeyId-123", + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_GetClusterAPIKey.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_cluster_by_id.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_cluster_by_id.py new file mode 100644 index 000000000000..045cd159c51d --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_cluster_by_id.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_get_cluster_by_id.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.get_cluster_by_id( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + environment_id="env-12132", + cluster_id="dlz-f3a90de", + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_GetClusterById.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_environment_by_id.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_environment_by_id.py new file mode 100644 index 000000000000..037553e4eceb --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_environment_by_id.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_get_environment_by_id.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.get_environment_by_id( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + environment_id="dlz-f3a90de", + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_GetEnvironmentById.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_schema_registry_cluster_by_id.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_schema_registry_cluster_by_id.py new file mode 100644 index 000000000000..e6ad0b38ae13 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_get_schema_registry_cluster_by_id.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_get_schema_registry_cluster_by_id.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.get_schema_registry_cluster_by_id( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + environment_id="env-stgcczjp2j3", + cluster_id="lsrc-stgczkq22z", + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_GetSchemaRegistryClusterById.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_resource_group.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_resource_group.py index b1d0b93ac763..fe2c6d8891ac 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_resource_group.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_resource_group.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Organization_ListByResourceGroup.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_ListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_subscription.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_subscription.py index 4c50b8f1b3f2..9daa33cb45b8 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_subscription.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_by_subscription.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Organization_ListBySubscription.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_ListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_regions.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_regions.py new file mode 100644 index 000000000000..fc521e32ccf1 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_regions.py @@ -0,0 +1,42 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_list_regions.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.list_regions( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + body={"searchFilters": {"cloud": "azure", "packages": "ADVANCED,ESSENTIALS", "region": "eastus"}}, + ) + print(response) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_ListRegions.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_schema_registry_clusters.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_schema_registry_clusters.py new file mode 100644 index 000000000000..83297ab9474a --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_list_schema_registry_clusters.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential +from azure.mgmt.confluent import ConfluentManagementClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-confluent +# USAGE + python organization_list_schema_registry_clusters.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = ConfluentManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-0000-0000-0000-000000000000", + ) + + response = client.organization.list_schema_registry_clusters( + resource_group_name="myResourceGroup", + organization_name="myOrganization", + environment_id="env-stgcczjp2j3", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_ListSchemaRegistryClusters.json +if __name__ == "__main__": + main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_operations_list.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_operations_list.py index a1b74b65d3ef..561702825525 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_operations_list.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_operations_list.py @@ -34,6 +34,6 @@ def main(): print(item) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/OrganizationOperations_List.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/OrganizationOperations_List.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_update.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_update.py index a275a9a25392..e084698312e3 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_update.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/organization_update.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Organization_Update.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Organization_Update.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations.py index 98914e1cfe67..7c72e27b557d 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations.py @@ -58,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Validations_ValidateOrganizations.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Validations_ValidateOrganizations.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations_v2.py b/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations_v2.py index bca27ddaa253..df402c10a27f 100644 --- a/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations_v2.py +++ b/sdk/confluent/azure-mgmt-confluent/generated_samples/validations_validate_organizations_v2.py @@ -58,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2023-08-22/examples/Validations_ValidateOrganizationsV2.json +# x-ms-original-file: specification/confluent/resource-manager/Microsoft.Confluent/stable/2024-02-13/examples/Validations_ValidateOrganizationsV2.json if __name__ == "__main__": main() diff --git a/sdk/confluent/azure-mgmt-confluent/setup.py b/sdk/confluent/azure-mgmt-confluent/setup.py index 8217c536bbfd..eebb6460f9a3 100644 --- a/sdk/confluent/azure-mgmt-confluent/setup.py +++ b/sdk/confluent/azure-mgmt-confluent/setup.py @@ -53,11 +53,11 @@ "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: MIT License", ], zip_safe=False, @@ -77,7 +77,6 @@ "isodate<1.0.0,>=0.6.1", "azure-common~=1.1", "azure-mgmt-core>=1.3.2,<2.0.0", - "typing-extensions>=4.3.0; python_version<'3.8.0'", ], - python_requires=">=3.7", + python_requires=">=3.8", )