diff --git a/sdk/confluent/azure-mgmt-confluent/MANIFEST.in b/sdk/confluent/azure-mgmt-confluent/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/confluent/azure-mgmt-confluent/MANIFEST.in +++ b/sdk/confluent/azure-mgmt-confluent/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/confluent/azure-mgmt-confluent/_meta.json b/sdk/confluent/azure-mgmt-confluent/_meta.json new file mode 100644 index 000000000000..53c01c63d039 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/_meta.json @@ -0,0 +1,11 @@ +{ + "autorest": "3.4.2", + "use": [ + "@autorest/python@5.8.0", + "@autorest/modelerfour@4.19.1" + ], + "commit": "28fc586030499f637db5b420c797dd694b6c85ee", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/confluent/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.1 --version=3.4.2", + "readme": "specification/confluent/resource-manager/readme.md" +} \ 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 b1e6095c8d3e..0b48dbf156a6 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" + self.api_version = "2021-03-01-preview" 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/_confluent_management_client.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/_confluent_management_client.py index 952287105b42..443d64ea8ab3 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 @@ -16,11 +16,13 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ConfluentManagementClientConfiguration from .operations import MarketplaceAgreementsOperations from .operations import OrganizationOperationsOperations from .operations import OrganizationOperations +from .operations import ValidationsOperations from . import models @@ -33,6 +35,8 @@ class ConfluentManagementClient(object): :vartype organization_operations: azure.mgmt.confluent.operations.OrganizationOperationsOperations :ivar organization: OrganizationOperations operations :vartype organization: azure.mgmt.confluent.operations.OrganizationOperations + :ivar validations: ValidationsOperations operations + :vartype validations: azure.mgmt.confluent.operations.ValidationsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Microsoft Azure subscription id. @@ -56,6 +60,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.marketplace_agreements = MarketplaceAgreementsOperations( @@ -64,6 +69,26 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.organization = OrganizationOperations( self._client, self._config, self._serialize, self._deserialize) + self.validations = ValidationsOperations( + self._client, self._config, self._serialize, self._deserialize) + + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response def close(self): # type: () -> None 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 385b02e26330..c3767b56d646 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", - "total_api_version_list": ["2020-03-01"], + "chosen_version": "2021-03-01-preview", + "total_api_version_list": ["2021-03-01-preview"], "client": { "name": "ConfluentManagementClient", "filename": "_confluent_management_client", @@ -9,7 +9,9 @@ "custom_base_url": null, "azure_arm": true, "has_lro_operations": true, - "client_side_validation": true + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConfluentManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConfluentManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -28,13 +30,13 @@ }, "async": { "credential": { - "signature": "credential, # type: \"AsyncTokenCredential\"", + "signature": "credential: \"AsyncTokenCredential\",", "description": "Credential needed for the client to connect to Azure.", "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", "required": true }, "subscription_id": { - "signature": "subscription_id, # type: str", + "signature": "subscription_id: str,", "description": "Microsoft Azure subscription id.", "docstring_type": "str", "required": true @@ -42,22 +44,63 @@ }, "constant": { }, - "call": "credential, subscription_id" + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } }, "config": { "credential": true, "credential_scopes": ["https://management.azure.com/.default"], "credential_default_policy_type": "BearerTokenCredentialPolicy", "credential_default_policy_type_has_async_version": true, - "credential_key_header_name": null + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" }, "operation_groups": { "marketplace_agreements": "MarketplaceAgreementsOperations", "organization_operations": "OrganizationOperationsOperations", - "organization": "OrganizationOperations" - }, - "operation_mixins": { - }, - "sync_imports": "None", - "async_imports": "None" + "organization": "OrganizationOperations", + "validations": "ValidationsOperations" + } } \ No newline at end of file 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 c47f66669f1b..e5754a47ce68 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.0" +VERSION = "1.0.0b1" 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 945f1e6ea100..c963369cfd9a 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" + self.api_version = "2021-03-01-preview" 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/_confluent_management_client.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/_confluent_management_client.py index 9e14a4e6ae14..936d61d2afe0 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 @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -19,6 +20,7 @@ from .operations import MarketplaceAgreementsOperations from .operations import OrganizationOperationsOperations from .operations import OrganizationOperations +from .operations import ValidationsOperations from .. import models @@ -31,6 +33,8 @@ class ConfluentManagementClient(object): :vartype organization_operations: azure.mgmt.confluent.aio.operations.OrganizationOperationsOperations :ivar organization: OrganizationOperations operations :vartype organization: azure.mgmt.confluent.aio.operations.OrganizationOperations + :ivar validations: ValidationsOperations operations + :vartype validations: azure.mgmt.confluent.aio.operations.ValidationsOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Microsoft Azure subscription id. @@ -53,6 +57,7 @@ def __init__( client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) + self._serialize.client_side_validation = False self._deserialize = Deserializer(client_models) self.marketplace_agreements = MarketplaceAgreementsOperations( @@ -61,6 +66,25 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.organization = OrganizationOperations( self._client, self._config, self._serialize, self._deserialize) + self.validations = ValidationsOperations( + self._client, self._config, self._serialize, self._deserialize) + + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response async def close(self) -> None: await self._client.close() diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/__init__.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/__init__.py index a48992bda8e6..e07bcdedfc82 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/__init__.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/__init__.py @@ -9,9 +9,11 @@ from ._marketplace_agreements_operations import MarketplaceAgreementsOperations from ._organization_operations_operations import OrganizationOperationsOperations from ._organization_operations import OrganizationOperations +from ._validations_operations import ValidationsOperations __all__ = [ 'MarketplaceAgreementsOperations', 'OrganizationOperationsOperations', 'OrganizationOperations', + 'ValidationsOperations', ] 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 dd7f160eacc1..6c29deb8b9a5 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 @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ConfluentAgreementResourceListResponse"]: """List Confluent marketplace agreements in the subscription. @@ -59,6 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -75,6 +76,7 @@ def prepare_request(next_link=None): url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: @@ -97,7 +99,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.failsafe_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) @@ -111,13 +113,13 @@ async def get_next(next_link=None): async def create( self, body: Optional["_models.ConfluentAgreementResource"] = None, - **kwargs + **kwargs: Any ) -> "_models.ConfluentAgreementResource": - """Accept marketplace terms. + """Create Confluent Marketplace agreement in the subscription. - Accept marketplace terms. + Create Confluent Marketplace agreement in the subscription. - :param body: Confluent Agreement resource. + :param body: Confluent Marketplace 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) @@ -129,6 +131,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -141,6 +144,7 @@ async def create( # Construct parameters query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -159,7 +163,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.failsafe_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 d11560bde3b3..205b58590846 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 @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OrganizationResourceListResult"]: """List all organizations under the specified subscription. @@ -61,7 +61,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_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,7 +115,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OrganizationResourceListResult"]: """List all Organizations under the specified resource group. @@ -133,7 +133,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_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) @@ -189,7 +189,7 @@ async def get( self, resource_group_name: str, organization_name: str, - **kwargs + **kwargs: Any ) -> "_models.OrganizationResource": """Get the properties of a specific Organization resource. @@ -209,7 +209,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -251,14 +251,14 @@ async def _create_initial( resource_group_name: str, organization_name: str, body: Optional["_models.OrganizationResource"] = None, - **kwargs + **kwargs: Any ) -> "_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" + api_version = "2021-03-01-preview" 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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -312,7 +312,7 @@ async def begin_create( resource_group_name: str, organization_name: str, body: Optional["_models.OrganizationResource"] = None, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.OrganizationResource"]: """Create Organization resource. @@ -326,8 +326,8 @@ async def begin_create( :type body: ~azure.mgmt.confluent.models.OrganizationResource :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. + 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.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either OrganizationResource or the result of cls(response) @@ -385,7 +385,7 @@ async def update( resource_group_name: str, organization_name: str, body: Optional["_models.OrganizationResourceUpdate"] = None, - **kwargs + **kwargs: Any ) -> "_models.OrganizationResource": """Update Organization resource. @@ -407,7 +407,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -441,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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -456,14 +456,14 @@ async def _delete_initial( self, resource_group_name: str, organization_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -489,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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -501,7 +501,7 @@ async def begin_delete( self, resource_group_name: str, organization_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete Organization resource. @@ -513,8 +513,8 @@ async def begin_delete( :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: By default, your polling method will be AsyncARMPolling. + 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.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) 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 060221341cf5..25d94c7b51ec 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 @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.OperationListResult"]: """List all operations provided by Microsoft.Confluent. @@ -59,7 +59,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_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/aio/operations/_validations_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_validations_operations.py new file mode 100644 index 000000000000..b5f4e96dcc92 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/aio/operations/_validations_operations.py @@ -0,0 +1,110 @@ +# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class ValidationsOperations: + """ValidationsOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.confluent.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + async def validate_organization( + self, + resource_group_name: str, + organization_name: str, + body: "_models.OrganizationResource", + **kwargs: Any + ) -> "_models.OrganizationResource": + """Organization Validate proxy resource. + + Organization Validate proxy resource. + + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param organization_name: Organization resource name. + :type organization_name: str + :param body: Organization resource model. + :type body: ~azure.mgmt.confluent.models.OrganizationResource + :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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_organization.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'OrganizationResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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, 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 + validate_organization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/validations/{organizationName}/orgvalidate'} # type: ignore 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 4aa452d1c8ea..9744155717fe 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 @@ -16,12 +16,9 @@ from ._models_py3 import OperationResult from ._models_py3 import OrganizationResource from ._models_py3 import OrganizationResourceListResult - from ._models_py3 import OrganizationResourceProperties - from ._models_py3 import OrganizationResourcePropertiesAutoGenerated - from ._models_py3 import OrganizationResourcePropertiesOfferDetail - from ._models_py3 import OrganizationResourcePropertiesUserDetail from ._models_py3 import OrganizationResourceUpdate from ._models_py3 import ResourceProviderDefaultErrorResponse + from ._models_py3 import SystemData from ._models_py3 import UserDetail except (SyntaxError, ImportError): from ._models import ConfluentAgreementResource # type: ignore @@ -33,15 +30,13 @@ from ._models import OperationResult # type: ignore from ._models import OrganizationResource # type: ignore from ._models import OrganizationResourceListResult # type: ignore - from ._models import OrganizationResourceProperties # type: ignore - from ._models import OrganizationResourcePropertiesAutoGenerated # type: ignore - from ._models import OrganizationResourcePropertiesOfferDetail # type: ignore - from ._models import OrganizationResourcePropertiesUserDetail # type: ignore from ._models import OrganizationResourceUpdate # type: ignore from ._models import ResourceProviderDefaultErrorResponse # type: ignore + from ._models import SystemData # type: ignore from ._models import UserDetail # type: ignore from ._confluent_management_client_enums import ( + CreatedByType, ProvisionState, SaaSOfferStatus, ) @@ -56,13 +51,11 @@ 'OperationResult', 'OrganizationResource', 'OrganizationResourceListResult', - 'OrganizationResourceProperties', - 'OrganizationResourcePropertiesAutoGenerated', - 'OrganizationResourcePropertiesOfferDetail', - 'OrganizationResourcePropertiesUserDetail', 'OrganizationResourceUpdate', 'ResourceProviderDefaultErrorResponse', + 'SystemData', 'UserDetail', + 'CreatedByType', 'ProvisionState', 'SaaSOfferStatus', ] diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_confluent_management_client_enums.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_confluent_management_client_enums.py index 77de969ccd09..93b95b746f2f 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_confluent_management_client_enums.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/models/_confluent_management_client_enums.py @@ -26,6 +26,15 @@ def __getattr__(cls, name): raise AttributeError(name) +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + class ProvisionState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Provision states for confluent RP """ 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 230b10dee250..667c5448e0d0 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 @@ -11,16 +11,18 @@ class ConfluentAgreementResource(msrest.serialization.Model): - """Confluent Agreements Resource. + """Agreement Terms definition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: ARM id of the resource. + :ivar id: The ARM id of the resource. :vartype id: str - :ivar name: Name of the agreement. + :ivar name: The name of the agreement. :vartype name: str - :ivar type: The type of the resource. + :ivar type: The type of the agreement. :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.confluent.models.SystemData :param publisher: Publisher identifier string. :type publisher: str :param product: Product identifier string. @@ -44,12 +46,14 @@ class ConfluentAgreementResource(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'publisher': {'key': 'properties.publisher', 'type': 'str'}, 'product': {'key': 'properties.product', 'type': 'str'}, 'plan': {'key': 'properties.plan', 'type': 'str'}, @@ -68,6 +72,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None self.publisher = kwargs.get('publisher', None) self.product = kwargs.get('product', None) self.plan = kwargs.get('plan', None) @@ -144,15 +149,17 @@ def __init__( class OfferDetail(msrest.serialization.Model): """Confluent Offer detail. - :param publisher_id: Publisher Id. + All required parameters must be populated in order to send to Azure. + + :param publisher_id: Required. Publisher Id. :type publisher_id: str - :param id: Offer Id. + :param id: Required. Offer Id. :type id: str - :param plan_id: Offer Plan Id. + :param plan_id: Required. Offer Plan Id. :type plan_id: str - :param plan_name: Offer Plan Name. + :param plan_name: Required. Offer Plan Name. :type plan_name: str - :param term_unit: Offer Plan Term unit. + :param term_unit: Required. Offer Plan Term unit. :type term_unit: str :param status: SaaS Offer Status. Possible values include: "Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", @@ -161,11 +168,11 @@ class OfferDetail(msrest.serialization.Model): """ _validation = { - 'publisher_id': {'max_length': 50, 'min_length': 0}, - 'id': {'max_length': 50, 'min_length': 0}, - 'plan_id': {'max_length': 50, 'min_length': 0}, - 'plan_name': {'max_length': 50, 'min_length': 0}, - 'term_unit': {'max_length': 25, 'min_length': 0}, + 'publisher_id': {'required': True, 'max_length': 50, 'min_length': 0}, + 'id': {'required': True, 'max_length': 50, 'min_length': 0}, + 'plan_id': {'required': True, 'max_length': 50, 'min_length': 0}, + 'plan_name': {'required': True, 'max_length': 50, 'min_length': 0}, + 'term_unit': {'required': True, 'max_length': 25, 'min_length': 0}, } _attribute_map = { @@ -182,11 +189,11 @@ def __init__( **kwargs ): super(OfferDetail, self).__init__(**kwargs) - self.publisher_id = kwargs.get('publisher_id', None) - self.id = kwargs.get('id', None) - self.plan_id = kwargs.get('plan_id', None) - self.plan_name = kwargs.get('plan_name', None) - self.term_unit = kwargs.get('term_unit', None) + self.publisher_id = kwargs['publisher_id'] + self.id = kwargs['id'] + self.plan_id = kwargs['plan_id'] + self.plan_name = kwargs['plan_name'] + self.term_unit = kwargs['term_unit'] self.status = kwargs.get('status', None) @@ -276,29 +283,33 @@ class OrganizationResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The ARM id of the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.confluent.models.SystemData :param tags: A set of tags. Organization resource tags. :type tags: dict[str, str] :param location: Location of Organization resource. :type location: str :ivar created_time: The creation time of the resource. :vartype created_time: ~datetime.datetime - :param provisioning_state: Provision states for confluent RP. Possible values include: + :ivar provisioning_state: Provision states for confluent RP. Possible values include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified". - :type provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState + :vartype provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState :ivar organization_id: Id of the Confluent organization. :vartype organization_id: str :ivar sso_url: SSO url for the Confluent organization. :vartype sso_url: str - :param offer_detail: Confluent offer detail. + :param offer_detail: Required. Confluent offer detail. :type offer_detail: ~azure.mgmt.confluent.models.OfferDetail - :param user_detail: Subscriber detail. + :param user_detail: Required. Subscriber detail. :type user_detail: ~azure.mgmt.confluent.models.UserDetail """ @@ -306,15 +317,20 @@ class OrganizationResource(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'created_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, 'organization_id': {'readonly': True}, 'sso_url': {'readonly': True}, + 'offer_detail': {'required': True}, + 'user_detail': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, @@ -333,14 +349,15 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None self.tags = kwargs.get('tags', None) self.location = kwargs.get('location', None) self.created_time = None - self.provisioning_state = kwargs.get('provisioning_state', None) + self.provisioning_state = None self.organization_id = None self.sso_url = None - self.offer_detail = kwargs.get('offer_detail', None) - self.user_detail = kwargs.get('user_detail', None) + self.offer_detail = kwargs['offer_detail'] + self.user_detail = kwargs['user_detail'] class OrganizationResourceListResult(msrest.serialization.Model): @@ -366,156 +383,108 @@ def __init__( self.next_link = kwargs.get('next_link', None) -class OrganizationResourceProperties(msrest.serialization.Model): - """Organization resource property. - - Variables are only populated by the server, and will be ignored when sending a request. +class OrganizationResourceUpdate(msrest.serialization.Model): + """Organization Resource update. - :ivar created_time: The creation time of the resource. - :vartype created_time: ~datetime.datetime - :param provisioning_state: Provision states for confluent RP. Possible values include: - "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", - "NotSpecified". - :type provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState - :ivar organization_id: Id of the Confluent organization. - :vartype organization_id: str - :ivar sso_url: SSO url for the Confluent organization. - :vartype sso_url: str - :param offer_detail: Confluent offer detail. - :type offer_detail: ~azure.mgmt.confluent.models.OfferDetail - :param user_detail: Subscriber detail. - :type user_detail: ~azure.mgmt.confluent.models.UserDetail + :param tags: A set of tags. ARM resource tags. + :type tags: dict[str, str] """ - _validation = { - 'created_time': {'readonly': True}, - 'organization_id': {'readonly': True}, - 'sso_url': {'readonly': True}, - } - _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'organization_id': {'key': 'organizationId', 'type': 'str'}, - 'sso_url': {'key': 'ssoUrl', 'type': 'str'}, - 'offer_detail': {'key': 'offerDetail', 'type': 'OfferDetail'}, - 'user_detail': {'key': 'userDetail', 'type': 'UserDetail'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__( self, **kwargs ): - super(OrganizationResourceProperties, self).__init__(**kwargs) - self.created_time = None - self.provisioning_state = kwargs.get('provisioning_state', None) - self.organization_id = None - self.sso_url = None - self.offer_detail = kwargs.get('offer_detail', None) - self.user_detail = kwargs.get('user_detail', None) + super(OrganizationResourceUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) -class OrganizationResourcePropertiesAutoGenerated(OrganizationResourceProperties): - """Organization resource properties. +class ResourceProviderDefaultErrorResponse(msrest.serialization.Model): + """Default error response for resource provider. Variables are only populated by the server, and will be ignored when sending a request. - :ivar created_time: The creation time of the resource. - :vartype created_time: ~datetime.datetime - :param provisioning_state: Provision states for confluent RP. Possible values include: - "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", - "NotSpecified". - :type provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState - :ivar organization_id: Id of the Confluent organization. - :vartype organization_id: str - :ivar sso_url: SSO url for the Confluent organization. - :vartype sso_url: str - :param offer_detail: Confluent offer detail. - :type offer_detail: ~azure.mgmt.confluent.models.OfferDetail - :param user_detail: Subscriber detail. - :type user_detail: ~azure.mgmt.confluent.models.UserDetail + :ivar error: Response body of Error. + :vartype error: ~azure.mgmt.confluent.models.ErrorResponseBody """ _validation = { - 'created_time': {'readonly': True}, - 'organization_id': {'readonly': True}, - 'sso_url': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'organization_id': {'key': 'organizationId', 'type': 'str'}, - 'sso_url': {'key': 'ssoUrl', 'type': 'str'}, - 'offer_detail': {'key': 'offerDetail', 'type': 'OfferDetail'}, - 'user_detail': {'key': 'userDetail', 'type': 'UserDetail'}, + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, } def __init__( self, **kwargs ): - super(OrganizationResourcePropertiesAutoGenerated, self).__init__(**kwargs) - + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.error = None -class OrganizationResourcePropertiesOfferDetail(OfferDetail): - """Confluent offer detail. - :param publisher_id: Publisher Id. - :type publisher_id: str - :param id: Offer Id. - :type id: str - :param plan_id: Offer Plan Id. - :type plan_id: str - :param plan_name: Offer Plan Name. - :type plan_name: str - :param term_unit: Offer Plan Term unit. - :type term_unit: str - :param status: SaaS Offer Status. Possible values include: "Started", - "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", - "Failed", "Unsubscribed", "Updating". - :type status: str or ~azure.mgmt.confluent.models.SaaSOfferStatus +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.confluent.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.confluent.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ - _validation = { - 'publisher_id': {'max_length': 50, 'min_length': 0}, - 'id': {'max_length': 50, 'min_length': 0}, - 'plan_id': {'max_length': 50, 'min_length': 0}, - 'plan_name': {'max_length': 50, 'min_length': 0}, - 'term_unit': {'max_length': 25, 'min_length': 0}, - } - _attribute_map = { - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'plan_name': {'key': 'planName', 'type': 'str'}, - 'term_unit': {'key': 'termUnit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, **kwargs ): - super(OrganizationResourcePropertiesOfferDetail, self).__init__(**kwargs) + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) class UserDetail(msrest.serialization.Model): """Subscriber detail. + All required parameters must be populated in order to send to Azure. + :param first_name: First name. :type first_name: str :param last_name: Last name. :type last_name: str - :param email_address: Email address. + :param email_address: Required. Email address. :type email_address: str """ _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': {'required': True, 'pattern': r'^\S+@\S+\.\S+$'}, } _attribute_map = { @@ -531,78 +500,4 @@ def __init__( super(UserDetail, self).__init__(**kwargs) self.first_name = kwargs.get('first_name', None) self.last_name = kwargs.get('last_name', None) - self.email_address = kwargs.get('email_address', None) - - -class OrganizationResourcePropertiesUserDetail(UserDetail): - """Subscriber detail. - - :param first_name: First name. - :type first_name: str - :param last_name: Last name. - :type last_name: str - :param email_address: Email address. - :type email_address: str - """ - - _validation = { - 'first_name': {'max_length': 50, 'min_length': 0}, - 'last_name': {'max_length': 50, 'min_length': 0}, - 'email_address': {'pattern': r'\S+@\S+\.\S+'}, - } - - _attribute_map = { - 'first_name': {'key': 'firstName', 'type': 'str'}, - 'last_name': {'key': 'lastName', 'type': 'str'}, - 'email_address': {'key': 'emailAddress', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(OrganizationResourcePropertiesUserDetail, self).__init__(**kwargs) - - -class OrganizationResourceUpdate(msrest.serialization.Model): - """Organization Resource update. - - :param tags: A set of tags. ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - **kwargs - ): - super(OrganizationResourceUpdate, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - - -class ResourceProviderDefaultErrorResponse(msrest.serialization.Model): - """Default error response for resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Response body of Error. - :vartype error: ~azure.mgmt.confluent.models.ErrorResponseBody - """ - - _validation = { - 'error': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) - self.error = None + self.email_address = kwargs['email_address'] 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 ba862ef037fe..7e5fef6d9e2f 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 @@ -16,16 +16,18 @@ class ConfluentAgreementResource(msrest.serialization.Model): - """Confluent Agreements Resource. + """Agreement Terms definition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: ARM id of the resource. + :ivar id: The ARM id of the resource. :vartype id: str - :ivar name: Name of the agreement. + :ivar name: The name of the agreement. :vartype name: str - :ivar type: The type of the resource. + :ivar type: The type of the agreement. :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.confluent.models.SystemData :param publisher: Publisher identifier string. :type publisher: str :param product: Product identifier string. @@ -49,12 +51,14 @@ class ConfluentAgreementResource(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'publisher': {'key': 'properties.publisher', 'type': 'str'}, 'product': {'key': 'properties.product', 'type': 'str'}, 'plan': {'key': 'properties.plan', 'type': 'str'}, @@ -82,6 +86,7 @@ def __init__( self.id = None self.name = None self.type = None + self.system_data = None self.publisher = publisher self.product = product self.plan = plan @@ -161,15 +166,17 @@ def __init__( class OfferDetail(msrest.serialization.Model): """Confluent Offer detail. - :param publisher_id: Publisher Id. + All required parameters must be populated in order to send to Azure. + + :param publisher_id: Required. Publisher Id. :type publisher_id: str - :param id: Offer Id. + :param id: Required. Offer Id. :type id: str - :param plan_id: Offer Plan Id. + :param plan_id: Required. Offer Plan Id. :type plan_id: str - :param plan_name: Offer Plan Name. + :param plan_name: Required. Offer Plan Name. :type plan_name: str - :param term_unit: Offer Plan Term unit. + :param term_unit: Required. Offer Plan Term unit. :type term_unit: str :param status: SaaS Offer Status. Possible values include: "Started", "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", @@ -178,11 +185,11 @@ class OfferDetail(msrest.serialization.Model): """ _validation = { - 'publisher_id': {'max_length': 50, 'min_length': 0}, - 'id': {'max_length': 50, 'min_length': 0}, - 'plan_id': {'max_length': 50, 'min_length': 0}, - 'plan_name': {'max_length': 50, 'min_length': 0}, - 'term_unit': {'max_length': 25, 'min_length': 0}, + 'publisher_id': {'required': True, 'max_length': 50, 'min_length': 0}, + 'id': {'required': True, 'max_length': 50, 'min_length': 0}, + 'plan_id': {'required': True, 'max_length': 50, 'min_length': 0}, + 'plan_name': {'required': True, 'max_length': 50, 'min_length': 0}, + 'term_unit': {'required': True, 'max_length': 25, 'min_length': 0}, } _attribute_map = { @@ -197,11 +204,11 @@ class OfferDetail(msrest.serialization.Model): def __init__( self, *, - publisher_id: Optional[str] = None, - id: Optional[str] = None, - plan_id: Optional[str] = None, - plan_name: Optional[str] = None, - term_unit: Optional[str] = None, + publisher_id: str, + id: str, + plan_id: str, + plan_name: str, + term_unit: str, status: Optional[Union[str, "SaaSOfferStatus"]] = None, **kwargs ): @@ -312,29 +319,33 @@ class OrganizationResource(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The ARM id of the resource. :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. :vartype type: str + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~azure.mgmt.confluent.models.SystemData :param tags: A set of tags. Organization resource tags. :type tags: dict[str, str] :param location: Location of Organization resource. :type location: str :ivar created_time: The creation time of the resource. :vartype created_time: ~datetime.datetime - :param provisioning_state: Provision states for confluent RP. Possible values include: + :ivar provisioning_state: Provision states for confluent RP. Possible values include: "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", "NotSpecified". - :type provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState + :vartype provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState :ivar organization_id: Id of the Confluent organization. :vartype organization_id: str :ivar sso_url: SSO url for the Confluent organization. :vartype sso_url: str - :param offer_detail: Confluent offer detail. + :param offer_detail: Required. Confluent offer detail. :type offer_detail: ~azure.mgmt.confluent.models.OfferDetail - :param user_detail: Subscriber detail. + :param user_detail: Required. Subscriber detail. :type user_detail: ~azure.mgmt.confluent.models.UserDetail """ @@ -342,15 +353,20 @@ class OrganizationResource(msrest.serialization.Model): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'created_time': {'readonly': True}, + 'provisioning_state': {'readonly': True}, 'organization_id': {'readonly': True}, 'sso_url': {'readonly': True}, + 'offer_detail': {'required': True}, + 'user_detail': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'created_time': {'key': 'properties.createdTime', 'type': 'iso-8601'}, @@ -364,21 +380,21 @@ class OrganizationResource(msrest.serialization.Model): def __init__( self, *, + offer_detail: "OfferDetail", + user_detail: "UserDetail", tags: Optional[Dict[str, str]] = None, location: Optional[str] = None, - provisioning_state: Optional[Union[str, "ProvisionState"]] = None, - offer_detail: Optional["OfferDetail"] = None, - user_detail: Optional["UserDetail"] = None, **kwargs ): super(OrganizationResource, self).__init__(**kwargs) self.id = None self.name = None self.type = None + self.system_data = None self.tags = tags self.location = location self.created_time = None - self.provisioning_state = provisioning_state + self.provisioning_state = None self.organization_id = None self.sso_url = None self.offer_detail = offer_detail @@ -411,171 +427,117 @@ def __init__( self.next_link = next_link -class OrganizationResourceProperties(msrest.serialization.Model): - """Organization resource property. - - Variables are only populated by the server, and will be ignored when sending a request. +class OrganizationResourceUpdate(msrest.serialization.Model): + """Organization Resource update. - :ivar created_time: The creation time of the resource. - :vartype created_time: ~datetime.datetime - :param provisioning_state: Provision states for confluent RP. Possible values include: - "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", - "NotSpecified". - :type provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState - :ivar organization_id: Id of the Confluent organization. - :vartype organization_id: str - :ivar sso_url: SSO url for the Confluent organization. - :vartype sso_url: str - :param offer_detail: Confluent offer detail. - :type offer_detail: ~azure.mgmt.confluent.models.OfferDetail - :param user_detail: Subscriber detail. - :type user_detail: ~azure.mgmt.confluent.models.UserDetail + :param tags: A set of tags. ARM resource tags. + :type tags: dict[str, str] """ - _validation = { - 'created_time': {'readonly': True}, - 'organization_id': {'readonly': True}, - 'sso_url': {'readonly': True}, - } - _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'organization_id': {'key': 'organizationId', 'type': 'str'}, - 'sso_url': {'key': 'ssoUrl', 'type': 'str'}, - 'offer_detail': {'key': 'offerDetail', 'type': 'OfferDetail'}, - 'user_detail': {'key': 'userDetail', 'type': 'UserDetail'}, + 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__( self, *, - provisioning_state: Optional[Union[str, "ProvisionState"]] = None, - offer_detail: Optional["OfferDetail"] = None, - user_detail: Optional["UserDetail"] = None, + tags: Optional[Dict[str, str]] = None, **kwargs ): - super(OrganizationResourceProperties, self).__init__(**kwargs) - self.created_time = None - self.provisioning_state = provisioning_state - self.organization_id = None - self.sso_url = None - self.offer_detail = offer_detail - self.user_detail = user_detail + super(OrganizationResourceUpdate, self).__init__(**kwargs) + self.tags = tags -class OrganizationResourcePropertiesAutoGenerated(OrganizationResourceProperties): - """Organization resource properties. +class ResourceProviderDefaultErrorResponse(msrest.serialization.Model): + """Default error response for resource provider. Variables are only populated by the server, and will be ignored when sending a request. - :ivar created_time: The creation time of the resource. - :vartype created_time: ~datetime.datetime - :param provisioning_state: Provision states for confluent RP. Possible values include: - "Accepted", "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled", "Deleted", - "NotSpecified". - :type provisioning_state: str or ~azure.mgmt.confluent.models.ProvisionState - :ivar organization_id: Id of the Confluent organization. - :vartype organization_id: str - :ivar sso_url: SSO url for the Confluent organization. - :vartype sso_url: str - :param offer_detail: Confluent offer detail. - :type offer_detail: ~azure.mgmt.confluent.models.OfferDetail - :param user_detail: Subscriber detail. - :type user_detail: ~azure.mgmt.confluent.models.UserDetail + :ivar error: Response body of Error. + :vartype error: ~azure.mgmt.confluent.models.ErrorResponseBody """ _validation = { - 'created_time': {'readonly': True}, - 'organization_id': {'readonly': True}, - 'sso_url': {'readonly': True}, + 'error': {'readonly': True}, } _attribute_map = { - 'created_time': {'key': 'createdTime', 'type': 'iso-8601'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'organization_id': {'key': 'organizationId', 'type': 'str'}, - 'sso_url': {'key': 'ssoUrl', 'type': 'str'}, - 'offer_detail': {'key': 'offerDetail', 'type': 'OfferDetail'}, - 'user_detail': {'key': 'userDetail', 'type': 'UserDetail'}, + 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, } def __init__( self, - *, - provisioning_state: Optional[Union[str, "ProvisionState"]] = None, - offer_detail: Optional["OfferDetail"] = None, - user_detail: Optional["UserDetail"] = None, **kwargs ): - super(OrganizationResourcePropertiesAutoGenerated, self).__init__(provisioning_state=provisioning_state, offer_detail=offer_detail, user_detail=user_detail, **kwargs) - + super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) + self.error = None -class OrganizationResourcePropertiesOfferDetail(OfferDetail): - """Confluent offer detail. - :param publisher_id: Publisher Id. - :type publisher_id: str - :param id: Offer Id. - :type id: str - :param plan_id: Offer Plan Id. - :type plan_id: str - :param plan_name: Offer Plan Name. - :type plan_name: str - :param term_unit: Offer Plan Term unit. - :type term_unit: str - :param status: SaaS Offer Status. Possible values include: "Started", - "PendingFulfillmentStart", "InProgress", "Subscribed", "Suspended", "Reinstated", "Succeeded", - "Failed", "Unsubscribed", "Updating". - :type status: str or ~azure.mgmt.confluent.models.SaaSOfferStatus +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~azure.mgmt.confluent.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~azure.mgmt.confluent.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC). + :type last_modified_at: ~datetime.datetime """ - _validation = { - 'publisher_id': {'max_length': 50, 'min_length': 0}, - 'id': {'max_length': 50, 'min_length': 0}, - 'plan_id': {'max_length': 50, 'min_length': 0}, - 'plan_name': {'max_length': 50, 'min_length': 0}, - 'term_unit': {'max_length': 25, 'min_length': 0}, - } - _attribute_map = { - 'publisher_id': {'key': 'publisherId', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, - 'plan_id': {'key': 'planId', 'type': 'str'}, - 'plan_name': {'key': 'planName', 'type': 'str'}, - 'term_unit': {'key': 'termUnit', 'type': 'str'}, - 'status': {'key': 'status', 'type': 'str'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } def __init__( self, *, - publisher_id: Optional[str] = None, - id: Optional[str] = None, - plan_id: Optional[str] = None, - plan_name: Optional[str] = None, - term_unit: Optional[str] = None, - status: Optional[Union[str, "SaaSOfferStatus"]] = None, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, **kwargs ): - super(OrganizationResourcePropertiesOfferDetail, self).__init__(publisher_id=publisher_id, id=id, plan_id=plan_id, plan_name=plan_name, term_unit=term_unit, status=status, **kwargs) + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at class UserDetail(msrest.serialization.Model): """Subscriber detail. + All required parameters must be populated in order to send to Azure. + :param first_name: First name. :type first_name: str :param last_name: Last name. :type last_name: str - :param email_address: Email address. + :param email_address: Required. Email address. :type email_address: str """ _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': {'required': True, 'pattern': r'^\S+@\S+\.\S+$'}, } _attribute_map = { @@ -587,92 +549,12 @@ class UserDetail(msrest.serialization.Model): def __init__( self, *, + email_address: str, first_name: Optional[str] = None, last_name: Optional[str] = None, - email_address: Optional[str] = None, **kwargs ): super(UserDetail, self).__init__(**kwargs) self.first_name = first_name self.last_name = last_name self.email_address = email_address - - -class OrganizationResourcePropertiesUserDetail(UserDetail): - """Subscriber detail. - - :param first_name: First name. - :type first_name: str - :param last_name: Last name. - :type last_name: str - :param email_address: Email address. - :type email_address: str - """ - - _validation = { - 'first_name': {'max_length': 50, 'min_length': 0}, - 'last_name': {'max_length': 50, 'min_length': 0}, - 'email_address': {'pattern': r'\S+@\S+\.\S+'}, - } - - _attribute_map = { - 'first_name': {'key': 'firstName', 'type': 'str'}, - 'last_name': {'key': 'lastName', 'type': 'str'}, - 'email_address': {'key': 'emailAddress', 'type': 'str'}, - } - - def __init__( - self, - *, - first_name: Optional[str] = None, - last_name: Optional[str] = None, - email_address: Optional[str] = None, - **kwargs - ): - super(OrganizationResourcePropertiesUserDetail, self).__init__(first_name=first_name, last_name=last_name, email_address=email_address, **kwargs) - - -class OrganizationResourceUpdate(msrest.serialization.Model): - """Organization Resource update. - - :param tags: A set of tags. ARM resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__( - self, - *, - tags: Optional[Dict[str, str]] = None, - **kwargs - ): - super(OrganizationResourceUpdate, self).__init__(**kwargs) - self.tags = tags - - -class ResourceProviderDefaultErrorResponse(msrest.serialization.Model): - """Default error response for resource provider. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error: Response body of Error. - :vartype error: ~azure.mgmt.confluent.models.ErrorResponseBody - """ - - _validation = { - 'error': {'readonly': True}, - } - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponseBody'}, - } - - def __init__( - self, - **kwargs - ): - super(ResourceProviderDefaultErrorResponse, self).__init__(**kwargs) - self.error = None diff --git a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/__init__.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/__init__.py index a48992bda8e6..e07bcdedfc82 100644 --- a/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/__init__.py +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/__init__.py @@ -9,9 +9,11 @@ from ._marketplace_agreements_operations import MarketplaceAgreementsOperations from ._organization_operations_operations import OrganizationOperationsOperations from ._organization_operations import OrganizationOperations +from ._validations_operations import ValidationsOperations __all__ = [ 'MarketplaceAgreementsOperations', 'OrganizationOperationsOperations', 'OrganizationOperations', + 'ValidationsOperations', ] 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 c6d702ab19d7..dfc6bd650456 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 @@ -64,6 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -80,6 +81,7 @@ def prepare_request(next_link=None): url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) else: @@ -102,7 +104,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.failsafe_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) @@ -119,11 +121,11 @@ def create( **kwargs # type: Any ): # type: (...) -> "_models.ConfluentAgreementResource" - """Accept marketplace terms. + """Create Confluent Marketplace agreement in the subscription. - Accept marketplace terms. + Create Confluent Marketplace agreement in the subscription. - :param body: Confluent Agreement resource. + :param body: Confluent Marketplace 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) @@ -135,6 +137,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -147,6 +150,7 @@ def create( # Construct parameters query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} # type: Dict[str, Any] @@ -165,7 +169,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.failsafe_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 f30ab91a40c4..a0053b6b7bf2 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 @@ -66,7 +66,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_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) @@ -139,7 +139,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_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) @@ -216,7 +216,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -266,7 +266,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -335,8 +335,8 @@ def begin_create( :type body: ~azure.mgmt.confluent.models.OrganizationResource :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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) @@ -417,7 +417,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -451,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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('OrganizationResource', pipeline_response) @@ -474,7 +474,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" accept = "application/json" # Construct URL @@ -500,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.failsafe_deserialize(_models.ResourceProviderDefaultErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -525,8 +525,8 @@ def begin_delete( :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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) 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 cc5f58b590f3..f12f9c422f69 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 @@ -64,7 +64,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-03-01" + api_version = "2021-03-01-preview" 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.failsafe_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/operations/_validations_operations.py b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_validations_operations.py new file mode 100644 index 000000000000..3b57f3bad282 --- /dev/null +++ b/sdk/confluent/azure-mgmt-confluent/azure/mgmt/confluent/operations/_validations_operations.py @@ -0,0 +1,115 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ValidationsOperations(object): + """ValidationsOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.confluent.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def validate_organization( + self, + resource_group_name, # type: str + organization_name, # type: str + body, # type: "_models.OrganizationResource" + **kwargs # type: Any + ): + # type: (...) -> "_models.OrganizationResource" + """Organization Validate proxy resource. + + Organization Validate proxy resource. + + :param resource_group_name: Resource group name. + :type resource_group_name: str + :param organization_name: Organization resource name. + :type organization_name: str + :param body: Organization resource model. + :type body: ~azure.mgmt.confluent.models.OrganizationResource + :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"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-03-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.validate_organization.metadata['url'] # type: ignore + 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'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(body, 'OrganizationResource') + body_content_kwargs['content'] = body_content + request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **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, 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 + validate_organization.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/validations/{organizationName}/orgvalidate'} # type: ignore