diff --git a/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md b/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md index 0b8b1bd77727..98a1acf9daf0 100644 --- a/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md +++ b/sdk/confluent/azure-mgmt-confluent/CHANGELOG.md @@ -1,5 +1,16 @@ # Release History +## 1.0.0 (2021-01-18) + +**Features** + + - Model OperationResult has a new parameter is_data_action + +**Breaking changes** + - Operation MarketplaceAgreementsOperations.create has a new signature + - Operation OrganizationOperations.update has a new signature + - Model ConfluentAgreementResource has a new signature + ## 1.0.0b1 (2020-11-23) * Initial Release diff --git a/sdk/confluent/azure-mgmt-confluent/README.md b/sdk/confluent/azure-mgmt-confluent/README.md index 65a86c4778b0..4f74d9d6eb82 100644 --- a/sdk/confluent/azure-mgmt-confluent/README.md +++ b/sdk/confluent/azure-mgmt-confluent/README.md @@ -25,3 +25,13 @@ section of the project. ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-confluent%2FREADME.png) +# Usage + + +To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) + + + +For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) +Code samples for this package can be found at [Confluent Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. +Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) 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 d9022ac8658e..b1e6095c8d3e 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_configuration.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-03-01-preview" + self.api_version = "2020-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-confluent/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_metadata.json b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_metadata.json index a27d55bc7141..385b02e26330 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_metadata.json +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2020-03-01-preview", - "total_api_version_list": ["2020-03-01-preview"], + "chosen_version": "2020-03-01", + "total_api_version_list": ["2020-03-01"], "client": { "name": "ConfluentManagementClient", "filename": "_confluent_management_client", @@ -8,32 +8,33 @@ "base_url": "\u0027https://management.azure.com\u0027", "custom_base_url": null, "azure_arm": true, - "has_lro_operations": true + "has_lro_operations": true, + "client_side_validation": true }, "global_parameters": { - "sync_method": { + "sync": { "credential": { - "method_signature": "credential, # type: \"TokenCredential\"", + "signature": "credential, # type: \"TokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials.TokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Microsoft Azure subscription id.", "docstring_type": "str", "required": true } }, - "async_method": { + "async": { "credential": { - "method_signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential, # type: \"AsyncTokenCredential\"", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "method_signature": "subscription_id, # type: str", + "signature": "subscription_id, # type: str", "description": "Microsoft Azure subscription id.", "docstring_type": "str", "required": true 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 e5754a47ce68..c47f66669f1b 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 = "1.0.0b1" +VERSION = "1.0.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 d17bb6d7dbc2..945f1e6ea100 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 @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-03-01-preview" + self.api_version = "2020-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-confluent/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_marketplace_agreements_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_marketplace_agreements_operations.py index 8f2c97502a6f..dd7f160eacc1 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_marketplace_agreements_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_marketplace_agreements_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class MarketplaceAgreementsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.ConfluentAgreementResourceListResponse"]: + ) -> AsyncIterable["_models.ConfluentAgreementResourceListResponse"]: """List Confluent marketplace agreements in the subscription. List Confluent marketplace agreements in the subscription. @@ -54,7 +54,7 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.confluent.models.ConfluentAgreementResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConfluentAgreementResourceListResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfluentAgreementResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -97,7 +97,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -110,27 +110,25 @@ async def get_next(next_link=None): async def create( self, - properties: Optional["models.ConfluentAgreementProperties"] = None, + body: Optional["_models.ConfluentAgreementResource"] = None, **kwargs - ) -> "models.ConfluentAgreementResource": - """Create Confluent Marketplace agreement in the subscription. + ) -> "_models.ConfluentAgreementResource": + """Accept marketplace terms. - Create Confluent Marketplace agreement in the subscription. + Accept marketplace terms. - :param properties: Represents the properties of the resource. - :type properties: ~azure.mgmt.confluent.models.ConfluentAgreementProperties + :param body: Confluent Agreement resource. + :type body: ~azure.mgmt.confluent.models.ConfluentAgreementResource :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfluentAgreementResource, or the result of cls(response) :rtype: ~azure.mgmt.confluent.models.ConfluentAgreementResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConfluentAgreementResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfluentAgreementResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _body = models.ConfluentAgreementResource(properties=properties) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -150,8 +148,8 @@ async def create( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'ConfluentAgreementResource') + if body is not None: + body_content = self._serialize.body(body, 'ConfluentAgreementResource') else: body_content = None body_content_kwargs['content'] = body_content @@ -161,7 +159,7 @@ async def create( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConfluentAgreementResource', pipeline_response) 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 661e3a2620ae..d11560bde3b3 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -35,7 +35,7 @@ class OrganizationOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -46,7 +46,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_subscription( self, **kwargs - ) -> AsyncIterable["models.OrganizationResourceListResult"]: + ) -> AsyncIterable["_models.OrganizationResourceListResult"]: """List all organizations under the specified subscription. List all organizations under the specified subscription. @@ -56,12 +56,12 @@ def list_by_subscription( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.confluent.models.OrganizationResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -101,7 +101,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -116,7 +116,7 @@ def list_by_resource_group( self, resource_group_name: str, **kwargs - ) -> AsyncIterable["models.OrganizationResourceListResult"]: + ) -> AsyncIterable["_models.OrganizationResourceListResult"]: """List all Organizations under the specified resource group. List all Organizations under the specified resource group. @@ -128,12 +128,12 @@ def list_by_resource_group( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.confluent.models.OrganizationResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -174,7 +174,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -190,7 +190,7 @@ async def get( resource_group_name: str, organization_name: str, **kwargs - ) -> "models.OrganizationResource": + ) -> "_models.OrganizationResource": """Get the properties of a specific Organization resource. Get the properties of a specific Organization resource. @@ -204,12 +204,12 @@ async def get( :rtype: ~azure.mgmt.confluent.models.OrganizationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" # Construct URL @@ -235,7 +235,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -250,15 +250,15 @@ async def _create_initial( self, resource_group_name: str, organization_name: str, - body: Optional["models.OrganizationResource"] = None, + body: Optional["_models.OrganizationResource"] = None, **kwargs - ) -> "models.OrganizationResource": - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + ) -> "_models.OrganizationResource": + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -292,7 +292,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -311,9 +311,9 @@ async def begin_create( self, resource_group_name: str, organization_name: str, - body: Optional["models.OrganizationResource"] = None, + body: Optional["_models.OrganizationResource"] = None, **kwargs - ) -> AsyncLROPoller["models.OrganizationResource"]: + ) -> AsyncLROPoller["_models.OrganizationResource"]: """Create Organization resource. Create Organization resource. @@ -335,7 +335,7 @@ async def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -360,7 +360,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'organizationName': self._serialize.url("organization_name", organization_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: @@ -378,9 +384,9 @@ async def update( self, resource_group_name: str, organization_name: str, - tags: Optional[Dict[str, str]] = None, + body: Optional["_models.OrganizationResourceUpdate"] = None, **kwargs - ) -> "models.OrganizationResource": + ) -> "_models.OrganizationResource": """Update Organization resource. Update Organization resource. @@ -389,21 +395,19 @@ async def update( :type resource_group_name: str :param organization_name: Organization resource name. :type organization_name: str - :param tags: ARM resource tags. - :type tags: dict[str, str] + :param body: Updated Organization resource. + :type body: ~azure.mgmt.confluent.models.OrganizationResourceUpdate :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 """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _body = models.OrganizationResourceUpdate(tags=tags) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -426,8 +430,8 @@ async def update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'OrganizationResourceUpdate') + if body is not None: + body_content = self._serialize.body(body, 'OrganizationResourceUpdate') else: body_content = None body_content_kwargs['content'] = body_content @@ -437,7 +441,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -459,7 +463,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" # Construct URL @@ -485,7 +489,7 @@ async def _delete_initial( 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(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -539,7 +543,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'organizationName': self._serialize.url("organization_name", organization_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = AsyncNoPolling() else: polling_method = polling if cont_token: diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations_operations.py index fb4dc45eca46..060221341cf5 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations_operations.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_organization_operations_operations.py @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core.exceptions import ARMErrorFormat -from ... import models +from ... import models as _models T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -33,7 +33,7 @@ class OrganizationOperationsOperations: :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer) -> None: self._client = client @@ -44,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, **kwargs - ) -> AsyncIterable["models.OperationListResult"]: + ) -> AsyncIterable["_models.OperationListResult"]: """List all operations provided by Microsoft.Confluent. List all operations provided by Microsoft.Confluent. @@ -54,12 +54,12 @@ def list( :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.confluent.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -95,7 +95,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) 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 5100c1dc3669..4aa452d1c8ea 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 @@ -7,7 +7,6 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import ConfluentAgreementProperties from ._models_py3 import ConfluentAgreementResource from ._models_py3 import ConfluentAgreementResourceListResponse from ._models_py3 import ErrorResponseBody @@ -25,7 +24,6 @@ from ._models_py3 import ResourceProviderDefaultErrorResponse from ._models_py3 import UserDetail except (SyntaxError, ImportError): - from ._models import ConfluentAgreementProperties # type: ignore from ._models import ConfluentAgreementResource # type: ignore from ._models import ConfluentAgreementResourceListResponse # type: ignore from ._models import ErrorResponseBody # type: ignore @@ -49,7 +47,6 @@ ) __all__ = [ - 'ConfluentAgreementProperties', 'ConfluentAgreementResource', 'ConfluentAgreementResourceListResponse', 'ErrorResponseBody', diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models.py index abd9154042de..230b10dee250 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_models.py @@ -10,9 +10,17 @@ import msrest.serialization -class ConfluentAgreementProperties(msrest.serialization.Model): - """Terms properties for Marketplace and Confluent. +class ConfluentAgreementResource(msrest.serialization.Model): + """Confluent Agreements Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: ARM id of the resource. + :vartype id: str + :ivar name: Name of the agreement. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str :param publisher: Publisher identifier string. :type publisher: str :param product: Product identifier string. @@ -32,47 +40,6 @@ class ConfluentAgreementProperties(msrest.serialization.Model): :type accepted: bool """ - _attribute_map = { - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'plan': {'key': 'plan', 'type': 'str'}, - 'license_text_link': {'key': 'licenseTextLink', 'type': 'str'}, - 'privacy_policy_link': {'key': 'privacyPolicyLink', 'type': 'str'}, - 'retrieve_datetime': {'key': 'retrieveDatetime', 'type': 'iso-8601'}, - 'signature': {'key': 'signature', 'type': 'str'}, - 'accepted': {'key': 'accepted', 'type': 'bool'}, - } - - def __init__( - self, - **kwargs - ): - super(ConfluentAgreementProperties, self).__init__(**kwargs) - self.publisher = kwargs.get('publisher', None) - self.product = kwargs.get('product', None) - self.plan = kwargs.get('plan', None) - self.license_text_link = kwargs.get('license_text_link', None) - self.privacy_policy_link = kwargs.get('privacy_policy_link', None) - self.retrieve_datetime = kwargs.get('retrieve_datetime', None) - self.signature = kwargs.get('signature', None) - self.accepted = kwargs.get('accepted', None) - - -class ConfluentAgreementResource(msrest.serialization.Model): - """Agreement Terms definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM id of the resource. - :vartype id: str - :ivar name: The name of the agreement. - :vartype name: str - :ivar type: The type of the agreement. - :vartype type: str - :param properties: Represents the properties of the resource. - :type properties: ~azure.mgmt.confluent.models.ConfluentAgreementProperties - """ - _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, @@ -83,7 +50,14 @@ class ConfluentAgreementResource(msrest.serialization.Model): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ConfluentAgreementProperties'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'plan': {'key': 'properties.plan', 'type': 'str'}, + 'license_text_link': {'key': 'properties.licenseTextLink', 'type': 'str'}, + 'privacy_policy_link': {'key': 'properties.privacyPolicyLink', 'type': 'str'}, + 'retrieve_datetime': {'key': 'properties.retrieveDatetime', 'type': 'iso-8601'}, + 'signature': {'key': 'properties.signature', 'type': 'str'}, + 'accepted': {'key': 'properties.accepted', 'type': 'bool'}, } def __init__( @@ -94,11 +68,18 @@ def __init__( self.id = None self.name = None self.type = None - self.properties = kwargs.get('properties', None) + self.publisher = kwargs.get('publisher', None) + self.product = kwargs.get('product', None) + self.plan = kwargs.get('plan', None) + self.license_text_link = kwargs.get('license_text_link', None) + self.privacy_policy_link = kwargs.get('privacy_policy_link', None) + self.retrieve_datetime = kwargs.get('retrieve_datetime', None) + self.signature = kwargs.get('signature', None) + self.accepted = kwargs.get('accepted', None) class ConfluentAgreementResourceListResponse(msrest.serialization.Model): - """Response of a agreements operation. + """Response of a list operation. :param value: Results of a list operation. :type value: list[~azure.mgmt.confluent.models.ConfluentAgreementResource] @@ -270,11 +251,14 @@ class OperationResult(msrest.serialization.Model): :type name: str :param display: The object that represents the operation. :type display: ~azure.mgmt.confluent.models.OperationDisplay + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } def __init__( @@ -284,6 +268,7 @@ def __init__( super(OperationResult, self).__init__(**kwargs) self.name = kwargs.get('name', None) self.display = kwargs.get('display', None) + self.is_data_action = kwargs.get('is_data_action', None) class OrganizationResource(msrest.serialization.Model): @@ -530,7 +515,7 @@ class UserDetail(msrest.serialization.Model): _validation = { 'first_name': {'max_length': 50, 'min_length': 0}, 'last_name': {'max_length': 50, 'min_length': 0}, - 'email_address': {'pattern': r'^\S+@\S+\.\S+$'}, + 'email_address': {'pattern': r'\S+@\S+\.\S+'}, } _attribute_map = { @@ -563,7 +548,7 @@ class OrganizationResourcePropertiesUserDetail(UserDetail): _validation = { 'first_name': {'max_length': 50, 'min_length': 0}, 'last_name': {'max_length': 50, 'min_length': 0}, - 'email_address': {'pattern': r'^\S+@\S+\.\S+$'}, + 'email_address': {'pattern': r'\S+@\S+\.\S+'}, } _attribute_map = { 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 d63393738b06..ba862ef037fe 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 @@ -15,9 +15,17 @@ from ._confluent_management_client_enums import * -class ConfluentAgreementProperties(msrest.serialization.Model): - """Terms properties for Marketplace and Confluent. +class ConfluentAgreementResource(msrest.serialization.Model): + """Confluent Agreements Resource. + + Variables are only populated by the server, and will be ignored when sending a request. + :ivar id: ARM id of the resource. + :vartype id: str + :ivar name: Name of the agreement. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str :param publisher: Publisher identifier string. :type publisher: str :param product: Product identifier string. @@ -37,15 +45,24 @@ class ConfluentAgreementProperties(msrest.serialization.Model): :type accepted: bool """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'publisher': {'key': 'publisher', 'type': 'str'}, - 'product': {'key': 'product', 'type': 'str'}, - 'plan': {'key': 'plan', 'type': 'str'}, - 'license_text_link': {'key': 'licenseTextLink', 'type': 'str'}, - 'privacy_policy_link': {'key': 'privacyPolicyLink', 'type': 'str'}, - 'retrieve_datetime': {'key': 'retrieveDatetime', 'type': 'iso-8601'}, - 'signature': {'key': 'signature', 'type': 'str'}, - 'accepted': {'key': 'accepted', 'type': 'bool'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'publisher': {'key': 'properties.publisher', 'type': 'str'}, + 'product': {'key': 'properties.product', 'type': 'str'}, + 'plan': {'key': 'properties.plan', 'type': 'str'}, + 'license_text_link': {'key': 'properties.licenseTextLink', 'type': 'str'}, + 'privacy_policy_link': {'key': 'properties.privacyPolicyLink', 'type': 'str'}, + 'retrieve_datetime': {'key': 'properties.retrieveDatetime', 'type': 'iso-8601'}, + 'signature': {'key': 'properties.signature', 'type': 'str'}, + 'accepted': {'key': 'properties.accepted', 'type': 'bool'}, } def __init__( @@ -61,7 +78,10 @@ def __init__( accepted: Optional[bool] = None, **kwargs ): - super(ConfluentAgreementProperties, self).__init__(**kwargs) + super(ConfluentAgreementResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None self.publisher = publisher self.product = product self.plan = plan @@ -72,49 +92,8 @@ def __init__( self.accepted = accepted -class ConfluentAgreementResource(msrest.serialization.Model): - """Agreement Terms definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The ARM id of the resource. - :vartype id: str - :ivar name: The name of the agreement. - :vartype name: str - :ivar type: The type of the agreement. - :vartype type: str - :param properties: Represents the properties of the resource. - :type properties: ~azure.mgmt.confluent.models.ConfluentAgreementProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'properties': {'key': 'properties', 'type': 'ConfluentAgreementProperties'}, - } - - def __init__( - self, - *, - properties: Optional["ConfluentAgreementProperties"] = None, - **kwargs - ): - super(ConfluentAgreementResource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.properties = properties - - class ConfluentAgreementResourceListResponse(msrest.serialization.Model): - """Response of a agreements operation. + """Response of a list operation. :param value: Results of a list operation. :type value: list[~azure.mgmt.confluent.models.ConfluentAgreementResource] @@ -304,11 +283,14 @@ class OperationResult(msrest.serialization.Model): :type name: str :param display: The object that represents the operation. :type display: ~azure.mgmt.confluent.models.OperationDisplay + :param is_data_action: Indicates whether the operation is a data action. + :type is_data_action: bool """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, } def __init__( @@ -316,11 +298,13 @@ def __init__( *, name: Optional[str] = None, display: Optional["OperationDisplay"] = None, + is_data_action: Optional[bool] = None, **kwargs ): super(OperationResult, self).__init__(**kwargs) self.name = name self.display = display + self.is_data_action = is_data_action class OrganizationResource(msrest.serialization.Model): @@ -591,7 +575,7 @@ class UserDetail(msrest.serialization.Model): _validation = { 'first_name': {'max_length': 50, 'min_length': 0}, 'last_name': {'max_length': 50, 'min_length': 0}, - 'email_address': {'pattern': r'^\S+@\S+\.\S+$'}, + 'email_address': {'pattern': r'\S+@\S+\.\S+'}, } _attribute_map = { @@ -628,7 +612,7 @@ class OrganizationResourcePropertiesUserDetail(UserDetail): _validation = { 'first_name': {'max_length': 50, 'min_length': 0}, 'last_name': {'max_length': 50, 'min_length': 0}, - 'email_address': {'pattern': r'^\S+@\S+\.\S+$'}, + 'email_address': {'pattern': r'\S+@\S+\.\S+'}, } _attribute_map = { 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 76668b1eb270..c6d702ab19d7 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class MarketplaceAgreementsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.ConfluentAgreementResourceListResponse"] + # type: (...) -> Iterable["_models.ConfluentAgreementResourceListResponse"] """List Confluent marketplace agreements in the subscription. List Confluent marketplace agreements in the subscription. @@ -59,7 +59,7 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.ConfluentAgreementResourceListResponse] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConfluentAgreementResourceListResponse"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfluentAgreementResourceListResponse"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } @@ -102,7 +102,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -115,28 +115,26 @@ def get_next(next_link=None): def create( self, - properties=None, # type: Optional["models.ConfluentAgreementProperties"] + body=None, # type: Optional["_models.ConfluentAgreementResource"] **kwargs # type: Any ): - # type: (...) -> "models.ConfluentAgreementResource" - """Create Confluent Marketplace agreement in the subscription. + # type: (...) -> "_models.ConfluentAgreementResource" + """Accept marketplace terms. - Create Confluent Marketplace agreement in the subscription. + Accept marketplace terms. - :param properties: Represents the properties of the resource. - :type properties: ~azure.mgmt.confluent.models.ConfluentAgreementProperties + :param body: Confluent Agreement resource. + :type body: ~azure.mgmt.confluent.models.ConfluentAgreementResource :keyword callable cls: A custom type or function that will be passed the direct response :return: ConfluentAgreementResource, or the result of cls(response) :rtype: ~azure.mgmt.confluent.models.ConfluentAgreementResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.ConfluentAgreementResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ConfluentAgreementResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _body = models.ConfluentAgreementResource(properties=properties) content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -156,8 +154,8 @@ def create( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'ConfluentAgreementResource') + if body is not None: + body_content = self._serialize.body(body, 'ConfluentAgreementResource') else: body_content = None body_content_kwargs['content'] = body_content @@ -167,7 +165,7 @@ def create( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConfluentAgreementResource', pipeline_response) 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 61993f309c71..f30ab91a40c4 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 @@ -16,7 +16,7 @@ from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -39,7 +39,7 @@ class OrganizationOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -51,7 +51,7 @@ def list_by_subscription( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OrganizationResourceListResult"] + # type: (...) -> Iterable["_models.OrganizationResourceListResult"] """List all organizations under the specified subscription. List all organizations under the specified subscription. @@ -61,12 +61,12 @@ def list_by_subscription( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.OrganizationResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -106,7 +106,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -122,7 +122,7 @@ def list_by_resource_group( resource_group_name, # type: str **kwargs # type: Any ): - # type: (...) -> Iterable["models.OrganizationResourceListResult"] + # type: (...) -> Iterable["_models.OrganizationResourceListResult"] """List all Organizations under the specified resource group. List all Organizations under the specified resource group. @@ -134,12 +134,12 @@ def list_by_resource_group( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.OrganizationResourceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResourceListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResourceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -180,7 +180,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -197,7 +197,7 @@ def get( organization_name, # type: str **kwargs # type: Any ): - # type: (...) -> "models.OrganizationResource" + # type: (...) -> "_models.OrganizationResource" """Get the properties of a specific Organization resource. Get the properties of a specific Organization resource. @@ -211,12 +211,12 @@ def get( :rtype: ~azure.mgmt.confluent.models.OrganizationResource :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" # Construct URL @@ -242,7 +242,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -257,16 +257,16 @@ def _create_initial( self, resource_group_name, # type: str organization_name, # type: str - body=None, # type: Optional["models.OrganizationResource"] + body=None, # type: Optional["_models.OrganizationResource"] **kwargs # type: Any ): - # type: (...) -> "models.OrganizationResource" - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + # type: (...) -> "_models.OrganizationResource" + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -300,7 +300,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -319,10 +319,10 @@ def begin_create( self, resource_group_name, # type: str organization_name, # type: str - body=None, # type: Optional["models.OrganizationResource"] + body=None, # type: Optional["_models.OrganizationResource"] **kwargs # type: Any ): - # type: (...) -> LROPoller["models.OrganizationResource"] + # type: (...) -> LROPoller["_models.OrganizationResource"] """Create Organization resource. Create Organization resource. @@ -344,7 +344,7 @@ def begin_create( :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] lro_delay = kwargs.pop( 'polling_interval', self._config.polling_interval @@ -369,7 +369,13 @@ def get_long_running_output(pipeline_response): return cls(pipeline_response, deserialized, {}) return deserialized - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'organizationName': self._serialize.url("organization_name", organization_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: @@ -387,10 +393,10 @@ def update( self, resource_group_name, # type: str organization_name, # type: str - tags=None, # type: Optional[Dict[str, str]] + body=None, # type: Optional["_models.OrganizationResourceUpdate"] **kwargs # type: Any ): - # type: (...) -> "models.OrganizationResource" + # type: (...) -> "_models.OrganizationResource" """Update Organization resource. Update Organization resource. @@ -399,21 +405,19 @@ def update( :type resource_group_name: str :param organization_name: Organization resource name. :type organization_name: str - :param tags: ARM resource tags. - :type tags: dict[str, str] + :param body: Updated Organization resource. + :type body: ~azure.mgmt.confluent.models.OrganizationResourceUpdate :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 """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OrganizationResource"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OrganizationResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - - _body = models.OrganizationResourceUpdate(tags=tags) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -436,8 +440,8 @@ def update( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - if _body is not None: - body_content = self._serialize.body(_body, 'OrganizationResourceUpdate') + if body is not None: + body_content = self._serialize.body(body, 'OrganizationResourceUpdate') else: body_content = None body_content_kwargs['content'] = body_content @@ -447,7 +451,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -470,7 +474,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" # Construct URL @@ -496,7 +500,7 @@ def _delete_initial( 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(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -551,7 +555,13 @@ def get_long_running_output(pipeline_response): if cls: return cls(pipeline_response, None, {}) - if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'organizationName': self._serialize.url("organization_name", organization_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs) elif polling is False: polling_method = NoPolling() else: polling_method = polling if cont_token: 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 fc16899213eb..cc5f58b590f3 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 @@ -14,7 +14,7 @@ from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat -from .. import models +from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -37,7 +37,7 @@ class OrganizationOperationsOperations(object): :param deserializer: An object model deserializer. """ - models = models + models = _models def __init__(self, client, config, serializer, deserializer): self._client = client @@ -49,7 +49,7 @@ def list( self, **kwargs # type: Any ): - # type: (...) -> Iterable["models.OperationListResult"] + # type: (...) -> Iterable["_models.OperationListResult"] """List all operations provided by Microsoft.Confluent. List all operations provided by Microsoft.Confluent. @@ -59,12 +59,12 @@ def list( :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.confluent.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["models.OperationListResult"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01-preview" + api_version = "2020-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -100,7 +100,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(models.ResourceProviderDefaultErrorResponse, response) + error = self._deserialize(_models.ResourceProviderDefaultErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)