diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/CHANGELOG.md b/sdk/apimanagement/azure-mgmt-apimanagement/CHANGELOG.md index 717779ec2e0c..e205e4e43f91 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/CHANGELOG.md +++ b/sdk/apimanagement/azure-mgmt-apimanagement/CHANGELOG.md @@ -1,5 +1,61 @@ # Release History +## 2.0.0 (2021-03-25) + +**Features** + + - Model TagCollection has a new parameter count + - Model OpenIdConnectProviderCollection has a new parameter count + - Model TagResourceCollection has a new parameter count + - Model CertificateCollection has a new parameter count + - Model PolicyCollection has a new parameter count + - Model IssueAttachmentCollection has a new parameter count + - Model BackendServiceFabricClusterProperties has a new parameter client_certificate_id + - Model BackendCollection has a new parameter count + - Model SubscriptionCollection has a new parameter count + - Model RecipientEmailCollection has a new parameter count + - Model GatewayCollection has a new parameter count + - Model IssueCommentCollection has a new parameter count + - Model OperationCollection has a new parameter count + - Model DiagnosticCollection has a new parameter count + - Model ApiVersionSetCollection has a new parameter count + - Model ProductCollection has a new parameter count + - Model IssueCollection has a new parameter count + - Model NotificationCollection has a new parameter count + - Model UserCollection has a new parameter count + - Model IdentityProviderList has a new parameter count + - Model ApiReleaseCollection has a new parameter count + - Model TagDescriptionCollection has a new parameter count + - Model ApiRevisionCollection has a new parameter count + - Model CacheCollection has a new parameter count + - Model RecipientUserCollection has a new parameter count + - Model NamedValueCollection has a new parameter count + - Model EmailTemplateCollection has a new parameter count + - Model BackendCredentialsContract has a new parameter certificate_ids + - Model ApiCollection has a new parameter count + - Model GroupCollection has a new parameter count + - Model SchemaCollection has a new parameter count + - Added operation TenantAccessOperations.list_by_service + - Added operation TenantAccessOperations.create + - Added operation ApiManagementServiceOperations.get_domain_ownership_identifier + - Added operation NamedValueOperations.begin_refresh_secret + - Added operation CertificateOperations.refresh_secret + - Added operation DeletedServicesOperations.begin_purge + - Added operation UserSubscriptionOperations.get + - Added operation group PortalSettingsOperations + - Added operation group TenantSettingsOperations + - Added operation group GatewayCertificateAuthorityOperations + - Added operation group ApiManagementSkusOperations + +**Breaking changes** + + - Operation CertificateOperations.list_by_service has a new signature + - Operation NamedValueOperations.list_by_service has a new signature + - Removed operation DeletedServicesOperations.purge + - Removed operation TenantAccessGitOperations.list_secrets + - Removed operation TenantAccessGitOperations.get + - Model AccessInformationContract has a new signature + ## 1.0.0 (2020-12-21) **Features** diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py index b1c46615e4a1..fd1ab90d48d3 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_api_management_client.py @@ -50,6 +50,7 @@ from .operations import GatewayOperations from .operations import GatewayHostnameConfigurationOperations from .operations import GatewayApiOperations +from .operations import GatewayCertificateAuthorityOperations from .operations import GroupOperations from .operations import GroupUserOperations from .operations import IdentityProviderOperations @@ -64,6 +65,7 @@ from .operations import PolicyOperations from .operations import PolicyDescriptionOperations from .operations import PortalRevisionOperations +from .operations import PortalSettingsOperations from .operations import SignInSettingsOperations from .operations import SignUpSettingsOperations from .operations import DelegationSettingsOperations @@ -76,6 +78,8 @@ from .operations import QuotaByPeriodKeysOperations from .operations import RegionOperations from .operations import ReportsOperations +from .operations import TenantSettingsOperations +from .operations import ApiManagementSkusOperations from .operations import SubscriptionOperations from .operations import TagResourceOperations from .operations import TenantAccessOperations @@ -156,6 +160,8 @@ class ApiManagementClient(object): :vartype gateway_hostname_configuration: azure.mgmt.apimanagement.operations.GatewayHostnameConfigurationOperations :ivar gateway_api: GatewayApiOperations operations :vartype gateway_api: azure.mgmt.apimanagement.operations.GatewayApiOperations + :ivar gateway_certificate_authority: GatewayCertificateAuthorityOperations operations + :vartype gateway_certificate_authority: azure.mgmt.apimanagement.operations.GatewayCertificateAuthorityOperations :ivar group: GroupOperations operations :vartype group: azure.mgmt.apimanagement.operations.GroupOperations :ivar group_user: GroupUserOperations operations @@ -184,6 +190,8 @@ class ApiManagementClient(object): :vartype policy_description: azure.mgmt.apimanagement.operations.PolicyDescriptionOperations :ivar portal_revision: PortalRevisionOperations operations :vartype portal_revision: azure.mgmt.apimanagement.operations.PortalRevisionOperations + :ivar portal_settings: PortalSettingsOperations operations + :vartype portal_settings: azure.mgmt.apimanagement.operations.PortalSettingsOperations :ivar sign_in_settings: SignInSettingsOperations operations :vartype sign_in_settings: azure.mgmt.apimanagement.operations.SignInSettingsOperations :ivar sign_up_settings: SignUpSettingsOperations operations @@ -208,6 +216,10 @@ class ApiManagementClient(object): :vartype region: azure.mgmt.apimanagement.operations.RegionOperations :ivar reports: ReportsOperations operations :vartype reports: azure.mgmt.apimanagement.operations.ReportsOperations + :ivar tenant_settings: TenantSettingsOperations operations + :vartype tenant_settings: azure.mgmt.apimanagement.operations.TenantSettingsOperations + :ivar api_management_skus: ApiManagementSkusOperations operations + :vartype api_management_skus: azure.mgmt.apimanagement.operations.ApiManagementSkusOperations :ivar subscription: SubscriptionOperations operations :vartype subscription: azure.mgmt.apimanagement.operations.SubscriptionOperations :ivar tag_resource: TagResourceOperations operations @@ -318,6 +330,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.gateway_api = GatewayApiOperations( self._client, self._config, self._serialize, self._deserialize) + self.gateway_certificate_authority = GatewayCertificateAuthorityOperations( + self._client, self._config, self._serialize, self._deserialize) self.group = GroupOperations( self._client, self._config, self._serialize, self._deserialize) self.group_user = GroupUserOperations( @@ -346,6 +360,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.portal_revision = PortalRevisionOperations( self._client, self._config, self._serialize, self._deserialize) + self.portal_settings = PortalSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) self.sign_in_settings = SignInSettingsOperations( self._client, self._config, self._serialize, self._deserialize) self.sign_up_settings = SignUpSettingsOperations( @@ -370,6 +386,10 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.reports = ReportsOperations( self._client, self._config, self._serialize, self._deserialize) + self.tenant_settings = TenantSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.api_management_skus = ApiManagementSkusOperations( + self._client, self._config, self._serialize, self._deserialize) self.subscription = SubscriptionOperations( self._client, self._config, self._serialize, self._deserialize) self.tag_resource = TagResourceOperations( diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py index 3e2f794be50f..38989b8ec5c4 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-06-01-preview" + self.api_version = "2020-12-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-apimanagement/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_version.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_version.py index c47f66669f1b..48944bf3938a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_version.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_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 = "2.0.0" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py index e36cc2c87f41..2c72c10479ce 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py @@ -48,6 +48,7 @@ from .operations import GatewayOperations from .operations import GatewayHostnameConfigurationOperations from .operations import GatewayApiOperations +from .operations import GatewayCertificateAuthorityOperations from .operations import GroupOperations from .operations import GroupUserOperations from .operations import IdentityProviderOperations @@ -62,6 +63,7 @@ from .operations import PolicyOperations from .operations import PolicyDescriptionOperations from .operations import PortalRevisionOperations +from .operations import PortalSettingsOperations from .operations import SignInSettingsOperations from .operations import SignUpSettingsOperations from .operations import DelegationSettingsOperations @@ -74,6 +76,8 @@ from .operations import QuotaByPeriodKeysOperations from .operations import RegionOperations from .operations import ReportsOperations +from .operations import TenantSettingsOperations +from .operations import ApiManagementSkusOperations from .operations import SubscriptionOperations from .operations import TagResourceOperations from .operations import TenantAccessOperations @@ -154,6 +158,8 @@ class ApiManagementClient(object): :vartype gateway_hostname_configuration: azure.mgmt.apimanagement.aio.operations.GatewayHostnameConfigurationOperations :ivar gateway_api: GatewayApiOperations operations :vartype gateway_api: azure.mgmt.apimanagement.aio.operations.GatewayApiOperations + :ivar gateway_certificate_authority: GatewayCertificateAuthorityOperations operations + :vartype gateway_certificate_authority: azure.mgmt.apimanagement.aio.operations.GatewayCertificateAuthorityOperations :ivar group: GroupOperations operations :vartype group: azure.mgmt.apimanagement.aio.operations.GroupOperations :ivar group_user: GroupUserOperations operations @@ -182,6 +188,8 @@ class ApiManagementClient(object): :vartype policy_description: azure.mgmt.apimanagement.aio.operations.PolicyDescriptionOperations :ivar portal_revision: PortalRevisionOperations operations :vartype portal_revision: azure.mgmt.apimanagement.aio.operations.PortalRevisionOperations + :ivar portal_settings: PortalSettingsOperations operations + :vartype portal_settings: azure.mgmt.apimanagement.aio.operations.PortalSettingsOperations :ivar sign_in_settings: SignInSettingsOperations operations :vartype sign_in_settings: azure.mgmt.apimanagement.aio.operations.SignInSettingsOperations :ivar sign_up_settings: SignUpSettingsOperations operations @@ -206,6 +214,10 @@ class ApiManagementClient(object): :vartype region: azure.mgmt.apimanagement.aio.operations.RegionOperations :ivar reports: ReportsOperations operations :vartype reports: azure.mgmt.apimanagement.aio.operations.ReportsOperations + :ivar tenant_settings: TenantSettingsOperations operations + :vartype tenant_settings: azure.mgmt.apimanagement.aio.operations.TenantSettingsOperations + :ivar api_management_skus: ApiManagementSkusOperations operations + :vartype api_management_skus: azure.mgmt.apimanagement.aio.operations.ApiManagementSkusOperations :ivar subscription: SubscriptionOperations operations :vartype subscription: azure.mgmt.apimanagement.aio.operations.SubscriptionOperations :ivar tag_resource: TagResourceOperations operations @@ -315,6 +327,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.gateway_api = GatewayApiOperations( self._client, self._config, self._serialize, self._deserialize) + self.gateway_certificate_authority = GatewayCertificateAuthorityOperations( + self._client, self._config, self._serialize, self._deserialize) self.group = GroupOperations( self._client, self._config, self._serialize, self._deserialize) self.group_user = GroupUserOperations( @@ -343,6 +357,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.portal_revision = PortalRevisionOperations( self._client, self._config, self._serialize, self._deserialize) + self.portal_settings = PortalSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) self.sign_in_settings = SignInSettingsOperations( self._client, self._config, self._serialize, self._deserialize) self.sign_up_settings = SignUpSettingsOperations( @@ -367,6 +383,10 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.reports = ReportsOperations( self._client, self._config, self._serialize, self._deserialize) + self.tenant_settings = TenantSettingsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.api_management_skus = ApiManagementSkusOperations( + self._client, self._config, self._serialize, self._deserialize) self.subscription = SubscriptionOperations( self._client, self._config, self._serialize, self._deserialize) self.tag_resource = TagResourceOperations( diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py index 0ecefbb90121..4e5bc34cdd4f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-06-01-preview" + self.api_version = "2020-12-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-apimanagement/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/__init__.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/__init__.py index 9a9b4ae48f31..cd77fa38b0ba 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/__init__.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/__init__.py @@ -38,6 +38,7 @@ from ._gateway_operations import GatewayOperations from ._gateway_hostname_configuration_operations import GatewayHostnameConfigurationOperations from ._gateway_api_operations import GatewayApiOperations +from ._gateway_certificate_authority_operations import GatewayCertificateAuthorityOperations from ._group_operations import GroupOperations from ._group_user_operations import GroupUserOperations from ._identity_provider_operations import IdentityProviderOperations @@ -52,6 +53,7 @@ from ._policy_operations import PolicyOperations from ._policy_description_operations import PolicyDescriptionOperations from ._portal_revision_operations import PortalRevisionOperations +from ._portal_settings_operations import PortalSettingsOperations from ._sign_in_settings_operations import SignInSettingsOperations from ._sign_up_settings_operations import SignUpSettingsOperations from ._delegation_settings_operations import DelegationSettingsOperations @@ -64,6 +66,8 @@ from ._quota_by_period_keys_operations import QuotaByPeriodKeysOperations from ._region_operations import RegionOperations from ._reports_operations import ReportsOperations +from ._tenant_settings_operations import TenantSettingsOperations +from ._api_management_skus_operations import ApiManagementSkusOperations from ._subscription_operations import SubscriptionOperations from ._tag_resource_operations import TagResourceOperations from ._tenant_access_operations import TenantAccessOperations @@ -108,6 +112,7 @@ 'GatewayOperations', 'GatewayHostnameConfigurationOperations', 'GatewayApiOperations', + 'GatewayCertificateAuthorityOperations', 'GroupOperations', 'GroupUserOperations', 'IdentityProviderOperations', @@ -122,6 +127,7 @@ 'PolicyOperations', 'PolicyDescriptionOperations', 'PortalRevisionOperations', + 'PortalSettingsOperations', 'SignInSettingsOperations', 'SignUpSettingsOperations', 'DelegationSettingsOperations', @@ -134,6 +140,8 @@ 'QuotaByPeriodKeysOperations', 'RegionOperations', 'ReportsOperations', + 'TenantSettingsOperations', + 'ApiManagementSkusOperations', 'SubscriptionOperations', 'TagResourceOperations', 'TenantAccessOperations', diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py index e06bdd9fdd6c..e40196255d6c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py @@ -77,7 +77,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -166,7 +166,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -235,7 +235,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -312,7 +312,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -401,7 +401,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -481,7 +481,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py index 72985c4e4bb6..1a74ef34510e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py @@ -74,7 +74,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py index 431c19da90ba..702fe4d1db82 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -177,7 +177,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -251,7 +251,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -333,7 +333,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -424,7 +424,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py index 7113939466ad..b0dfd30da6fd 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -176,7 +176,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -249,7 +249,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -330,7 +330,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -420,7 +420,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py index 56b52d25b59a..7b51b420602d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -173,7 +173,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -245,7 +245,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -324,7 +324,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -413,7 +413,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -493,7 +493,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py index 99c0f39c7649..d9773dc36d81 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -93,8 +93,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py index 73e5a6d49812..6cce8a47733e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py @@ -55,7 +55,7 @@ async def _restore_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -185,7 +185,7 @@ async def _backup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -313,7 +313,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -444,7 +444,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -581,7 +581,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -629,7 +629,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -754,7 +754,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -822,7 +822,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -862,8 +862,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -894,7 +895,7 @@ async def get_sso_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -950,7 +951,7 @@ async def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -990,6 +991,57 @@ async def check_name_availability( return deserialized check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability'} # type: ignore + async def get_domain_ownership_identifier( + self, + **kwargs + ) -> "_models.ApiManagementServiceGetDomainOwnershipIdentifierResult": + """Get the custom domain ownership identifier for an API Management service. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiManagementServiceGetDomainOwnershipIdentifierResult, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceGetDomainOwnershipIdentifierResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceGetDomainOwnershipIdentifierResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiManagementServiceGetDomainOwnershipIdentifierResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier'} # type: ignore + async def _apply_network_configuration_updates_initial( self, resource_group_name: str, @@ -1002,7 +1054,7 @@ async def _apply_network_configuration_updates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1057,7 +1109,7 @@ async def begin_apply_network_configuration_updates( **kwargs ) -> AsyncLROPoller["_models.ApiManagementServiceResource"]: """Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated - network settings. + DNS changes. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py index 7fb80c46f32a..c2a282f69554 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py @@ -65,7 +65,7 @@ def list_available_service_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py new file mode 100644 index 000000000000..459e8eb4bd89 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py @@ -0,0 +1,109 @@ +# 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, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +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 ApiManagementSkusOperations: + """ApiManagementSkusOperations 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.apimanagement.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 + + def list( + self, + **kwargs + ) -> AsyncIterable["_models.ApiManagementSkusResult"]: + """Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiManagementSkusResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiManagementSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ApiManagementSkusResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py index 267ec9929faa..b235a476e8ce 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py @@ -86,7 +86,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -178,7 +178,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -248,7 +248,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -326,7 +326,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -416,7 +416,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -497,7 +497,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py index d4f2bc1a47b5..e750c83f782d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py @@ -70,7 +70,7 @@ async def list_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -142,7 +142,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -219,7 +219,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -303,7 +303,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -394,7 +394,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py index 6f3c93fdbc49..f81df506e341 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py @@ -87,7 +87,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -176,7 +176,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -241,7 +241,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json, application/vnd.swagger.doc+json, application/vnd.oai.openapi+json, application/vnd.sun.wadl+xml, application/wsdl+xml" # Construct URL @@ -300,7 +300,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -471,7 +471,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -550,7 +550,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -630,7 +630,7 @@ def list_by_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py index 2a8d46eaa2d6..50a82ce68482 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py @@ -66,7 +66,7 @@ async def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -133,7 +133,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -205,7 +205,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json, application/vnd.ms-azure-apim.policy+xml, application/vnd.ms-azure-apim.policy.raw+xml" # Construct URL @@ -289,7 +289,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -375,7 +375,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py index 803318b51193..6a08af1ce936 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py @@ -77,7 +77,7 @@ def list_by_apis( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py index cdad34a714c0..a13634786c3b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py @@ -79,7 +79,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -168,7 +168,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -237,7 +237,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -314,7 +314,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -403,7 +403,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -483,7 +483,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py index be03cdb8e098..01c49026f9b7 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py @@ -77,7 +77,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py index 5f153d6507bc..2f8e5a8a4bec 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py @@ -80,7 +80,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -170,7 +170,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -240,7 +240,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -296,7 +296,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -478,7 +478,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py index a160f89602b2..567913b6b646 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py @@ -80,7 +80,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -170,7 +170,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -240,7 +240,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -318,7 +318,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -405,7 +405,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py index 8b8506c87e40..3d55ecf63c5a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py @@ -73,7 +73,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -158,7 +158,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -223,7 +223,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -296,7 +296,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -381,7 +381,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -457,7 +457,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py index 884d3b0061e7..a9b984a51eb4 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py @@ -76,7 +76,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -160,7 +160,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -224,7 +224,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -296,7 +296,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -380,7 +380,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -455,7 +455,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -516,7 +516,7 @@ async def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py index 917491acc702..d7f4fcf4186b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py @@ -76,7 +76,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -161,7 +161,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -226,7 +226,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -299,7 +299,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -384,7 +384,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -460,7 +460,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -526,7 +526,7 @@ async def reconnect( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py index f8da47f3c677..ae8a3655bd54 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py @@ -69,7 +69,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -152,7 +152,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -217,7 +217,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -290,7 +290,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -375,7 +375,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -451,7 +451,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py index 629d9c00b495..6d9067bf4311 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py @@ -48,6 +48,7 @@ def list_by_service( filter: Optional[str] = None, top: Optional[int] = None, skip: Optional[int] = None, + is_key_vault_refresh_failed: Optional[bool] = None, **kwargs ) -> AsyncIterable["_models.CertificateCollection"]: """Lists a collection of all certificates in the specified service instance. @@ -67,6 +68,9 @@ def list_by_service( :type top: int :param skip: Number of records to skip. :type skip: int + :param is_key_vault_refresh_failed: When set to true, the response contains only certificates + entities which failed refresh. + :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateCollection or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.CertificateCollection] @@ -77,7 +81,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -102,6 +106,8 @@ def prepare_request(next_link=None): query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if is_key_vault_refresh_failed is not None: + query_parameters['isKeyVaultRefreshFailed'] = self._serialize.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -162,7 +168,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -227,7 +233,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -300,7 +306,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -382,7 +388,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -417,3 +423,69 @@ async def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + + async def refresh_secret( + self, + resource_group_name: str, + service_name: str, + certificate_id: str, + **kwargs + ) -> "_models.CertificateContract": + """From KeyVault, Refresh the certificate being used for authentication with the backend. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.refresh_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('CertificateContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py index 00625f1a1279..cf3fb3ff7dcd 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py @@ -66,7 +66,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -216,7 +216,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -289,7 +289,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -369,7 +369,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py index 069309b57f4b..0c849ee78763 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py @@ -63,7 +63,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -141,7 +141,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -210,7 +210,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -286,7 +286,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py index 2d18015b8b21..8e03e2ca1655 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py @@ -62,7 +62,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -122,7 +122,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -190,7 +190,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -259,7 +259,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -325,7 +325,7 @@ async def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py index 73f7d097e17f..c80e4e8b4321 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py @@ -5,14 +5,16 @@ # 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, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings from azure.core.async_paging import AsyncItemPaged, AsyncList 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.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models @@ -57,7 +59,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -130,7 +132,7 @@ async def get_by_name( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -167,33 +169,22 @@ async def get_by_name( return deserialized get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore - async def purge( + async def _purge_initial( self, service_name: str, location: str, **kwargs ) -> Optional["_models.DeletedServiceContract"]: - """Purges Api Management Service (deletes it with no option to undelete). - - :param service_name: The name of the API Management service. - :type service_name: str - :param location: The location of the deleted API Management service. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeletedServiceContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.DeletedServiceContract or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DeletedServiceContract"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL - url = self.purge.metadata['url'] # type: ignore + url = self._purge_initial.metadata['url'] # type: ignore path_format_arguments = { 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), @@ -226,4 +217,71 @@ async def purge( return cls(pipeline_response, deserialized, {}) return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + + async def begin_purge( + self, + service_name: str, + location: str, + **kwargs + ) -> AsyncLROPoller["_models.DeletedServiceContract"]: + """Purges Api Management Service (deletes it with no option to undelete). + + :param service_name: The name of the API Management service. + :type service_name: str + :param location: The location of the deleted API Management service. + :type location: 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 + :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) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServiceContract"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._purge_initial( + service_name=service_name, + location=location, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DeletedServiceContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, '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: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py index d332ee554cc3..4a221d236564 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py @@ -74,7 +74,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -159,7 +159,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -224,7 +224,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -297,7 +297,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -382,7 +382,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -458,7 +458,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py index ae9eff64fd44..42c289ef5eee 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py @@ -74,7 +74,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -158,7 +158,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -222,7 +222,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -294,7 +294,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -375,7 +375,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -450,7 +450,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py index 1ff0910c27a1..2341c514a214 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py @@ -78,7 +78,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -167,7 +167,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -239,7 +239,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -319,7 +319,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py new file mode 100644 index 000000000000..f92f45befdeb --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py @@ -0,0 +1,441 @@ +# 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, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +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 GatewayCertificateAuthorityOperations: + """GatewayCertificateAuthorityOperations 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.apimanagement.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 + + def list_by_service( + self, + resource_group_name: str, + service_name: str, + gateway_id: str, + filter: Optional[str] = None, + top: Optional[int] = None, + skip: Optional[int] = None, + **kwargs + ) -> AsyncIterable["_models.GatewayCertificateAuthorityCollection"]: + """Lists the collection of Certificate Authorities for the specified Gateway entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param filter: | Field | Usage | Supported operators | Supported + functions |
|-------------|-------------|-------------|-------------|
| name | + filter | eq, ne | |
. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GatewayCertificateAuthorityCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('GatewayCertificateAuthorityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities'} # type: ignore + + async def get_entity_tag( + self, + resource_group_name: str, + service_name: str, + gateway_id: str, + certificate_id: str, + **kwargs + ) -> bool: + """Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-12-01" + accept = "application/json" + + # Construct URL + url = self.get_entity_tag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.head(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + + if cls: + return cls(pipeline_response, None, response_headers) + + return 200 <= response.status_code <= 299 + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + + async def get( + self, + resource_group_name: str, + service_name: str, + gateway_id: str, + certificate_id: str, + **kwargs + ) -> "_models.GatewayCertificateAuthorityContract": + """Get assigned Gateway Certificate Authority details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GatewayCertificateAuthorityContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('GatewayCertificateAuthorityContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + + async def create_or_update( + self, + resource_group_name: str, + service_name: str, + gateway_id: str, + certificate_id: str, + parameters: "_models.GatewayCertificateAuthorityContract", + if_match: Optional[str] = None, + **kwargs + ) -> "_models.GatewayCertificateAuthorityContract": + """Assign Certificate entity to Gateway entity as Certificate Authority. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :param parameters: + :type parameters: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + :param if_match: ETag of the Entity. Not required when creating an entity, but required when + updating an entity. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GatewayCertificateAuthorityContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'GatewayCertificateAuthorityContract') + body_content_kwargs['content'] = body_content + request = self._client.put(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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('GatewayCertificateAuthorityContract', pipeline_response) + + if response.status_code == 201: + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('GatewayCertificateAuthorityContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + + async def delete( + self, + resource_group_name: str, + service_name: str, + gateway_id: str, + certificate_id: str, + if_match: str, + **kwargs + ) -> None: + """Remove relationship between Certificate Authority and Gateway entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :param if_match: ETag of the Entity. ETag should match the current entity state from the header + response of the GET request or it should be * for unconditional update. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-12-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py index 95a09ec34419..cf819260d17b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py @@ -79,7 +79,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -170,7 +170,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -240,7 +240,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -318,7 +318,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -405,7 +405,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py index eae3f807362c..66b76a4a8c71 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py @@ -77,7 +77,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -162,7 +162,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -227,7 +227,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -300,7 +300,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -385,7 +385,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -461,7 +461,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -523,7 +523,7 @@ async def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -592,7 +592,7 @@ async def regenerate_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -661,7 +661,7 @@ async def generate_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py index 203f732212d2..ca825a3aec40 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py @@ -77,7 +77,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -162,7 +162,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -227,7 +227,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -300,7 +300,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -385,7 +385,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -461,7 +461,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py index 835430140800..e75d0e7b776f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py @@ -83,7 +83,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -172,7 +172,7 @@ async def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -238,7 +238,7 @@ async def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -310,7 +310,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py index 5d18a86ff732..b095e3e6cc9f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py @@ -63,7 +63,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -141,7 +141,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -206,7 +206,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -278,7 +278,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -362,7 +362,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -437,7 +437,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -498,7 +498,7 @@ async def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py index ea4fc85a2332..635e3df06369 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py @@ -79,7 +79,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -164,7 +164,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py index 6b3df2401da5..3faae87de128 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py @@ -77,7 +77,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -161,7 +161,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -225,7 +225,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -297,7 +297,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -381,7 +381,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -456,7 +456,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py index 89bb3170d8ab..0b07aeb0030a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py @@ -50,6 +50,7 @@ def list_by_service( filter: Optional[str] = None, top: Optional[int] = None, skip: Optional[int] = None, + is_key_vault_refresh_failed: Optional[bool] = None, **kwargs ) -> AsyncIterable["_models.NamedValueCollection"]: """Lists a collection of named values defined within a service instance. @@ -68,6 +69,9 @@ def list_by_service( :type top: int :param skip: Number of records to skip. :type skip: int + :param is_key_vault_refresh_failed: When set to true, the response contains only named value + entities which failed refresh. + :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NamedValueCollection or the result of cls(response) :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.NamedValueCollection] @@ -78,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -103,6 +107,8 @@ def prepare_request(next_link=None): query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if is_key_vault_refresh_failed is not None: + query_parameters['isKeyVaultRefreshFailed'] = self._serialize.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -162,7 +168,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -226,7 +232,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -280,7 +286,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -431,7 +437,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -592,7 +598,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -653,7 +659,7 @@ async def list_value( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -692,3 +698,132 @@ async def list_value( return deserialized list_value.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue'} # type: ignore + + async def _refresh_secret_initial( + self, + resource_group_name: str, + service_name: str, + named_value_id: str, + **kwargs + ) -> Optional["_models.NamedValueContract"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NamedValueContract"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._refresh_secret_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, min_length=0, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('NamedValueContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _refresh_secret_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore + + async def begin_refresh_secret( + self, + resource_group_name: str, + service_name: str, + named_value_id: str, + **kwargs + ) -> AsyncLROPoller["_models.NamedValueContract"]: + """Refresh the secret of the named value specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param named_value_id: Identifier of the NamedValue. + :type named_value_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 NamedValueContract or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._refresh_secret_initial( + resource_group_name=resource_group_name, + service_name=service_name, + named_value_id=named_value_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('NamedValueContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, min_length=0, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py index 2684c2cb0eaf..4c2d11b73419 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py @@ -64,7 +64,7 @@ async def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -129,7 +129,7 @@ async def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py index fb74542b6881..078625bf3251 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py @@ -69,7 +69,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -151,7 +151,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -218,7 +218,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py index 412d4a261904..9d21d80103b8 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py @@ -65,7 +65,7 @@ async def list_by_notification( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -131,7 +131,7 @@ async def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -267,7 +267,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py index c4e84d9b537a..818f8b344ac1 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py @@ -65,7 +65,7 @@ async def list_by_notification( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -131,7 +131,7 @@ async def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -196,7 +196,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -267,7 +267,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py index dbcc0d10bac6..e6b251bb2eef 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py @@ -76,7 +76,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -160,7 +160,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -224,7 +224,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -296,7 +296,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -380,7 +380,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -455,7 +455,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -516,7 +516,7 @@ async def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py index 8d8385107a84..ecda8df1cd66 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py @@ -87,7 +87,7 @@ def list_by_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -138,8 +138,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py index d751f3aae598..446375360fc8 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py @@ -65,7 +65,7 @@ async def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py index 9f3032510ce8..a42de63fc47c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py @@ -62,7 +62,7 @@ async def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -125,7 +125,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -192,7 +192,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -266,7 +266,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -347,7 +347,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py index f42035c82958..297e836b2d9c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py @@ -85,7 +85,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -170,7 +170,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -235,7 +235,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -288,7 +288,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -429,7 +429,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py new file mode 100644 index 000000000000..7faa2d28c18a --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py @@ -0,0 +1,100 @@ +# 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 PortalSettingsOperations: + """PortalSettingsOperations 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.apimanagement.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 list_by_service( + self, + resource_group_name: str, + service_name: str, + **kwargs + ) -> "_models.PortalSettingsCollection": + """Lists a collection of portalsettings defined within a service instance.. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PortalSettingsCollection, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.PortalSettingsCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSettingsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PortalSettingsCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py index d2167cce6e64..96fdbcded8fc 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py @@ -83,7 +83,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -173,7 +173,7 @@ async def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -240,7 +240,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -313,7 +313,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py index d0c5cc260e91..adb835af31a7 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py @@ -79,7 +79,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -169,7 +169,7 @@ async def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -236,7 +236,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -309,7 +309,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py index 8f0a30f349cc..26348c37b5ab 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py @@ -85,7 +85,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -174,7 +174,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -239,7 +239,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -312,7 +312,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -397,7 +397,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -476,7 +476,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -554,7 +554,7 @@ def list_by_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py index d7e428a510fb..841f5a308ac9 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py @@ -66,7 +66,7 @@ async def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -133,7 +133,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -205,7 +205,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -284,7 +284,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -370,7 +370,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py index 73b6bd38d70f..0e571562917e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py @@ -86,7 +86,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py index b1b3aa8d1f6f..6e0cc4227388 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py @@ -69,7 +69,7 @@ async def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -139,7 +139,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py index c55f66dfa241..372643281016 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py @@ -72,7 +72,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -145,7 +145,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py index 2bc910fcbc33..7dff9bbf3e53 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py @@ -63,7 +63,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py index 3b6a7d9d88bf..6ed5bab4015f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py @@ -76,7 +76,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -125,8 +125,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -181,7 +182,7 @@ def list_by_user( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -230,8 +231,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -286,7 +288,7 @@ def list_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -335,8 +337,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -390,7 +393,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -439,8 +442,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -492,7 +496,7 @@ def list_by_geo( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -539,8 +543,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -594,7 +599,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -643,8 +648,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -704,7 +710,7 @@ def list_by_time( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -754,8 +760,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -799,7 +806,7 @@ def list_by_request( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -846,8 +853,9 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py index 759d3f116b3b..e9bc02464ffe 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py @@ -62,7 +62,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -122,7 +122,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -190,7 +190,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -259,7 +259,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py index d05d863fda8c..053ffe6e99c0 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py @@ -62,7 +62,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -122,7 +122,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -190,7 +190,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -259,7 +259,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py index 2d76b872d0f4..d3e4cecdfc00 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py @@ -82,7 +82,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -168,7 +168,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -233,7 +233,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -317,7 +317,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -417,7 +417,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -497,7 +497,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -559,7 +559,7 @@ async def regenerate_primary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -620,7 +620,7 @@ async def regenerate_secondary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -681,7 +681,7 @@ async def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py index 4f737bdfdc34..125215384a02 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py @@ -83,7 +83,7 @@ def list_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -177,7 +177,7 @@ async def get_entity_state_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -251,7 +251,7 @@ async def get_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -326,7 +326,7 @@ async def assign_to_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -403,7 +403,7 @@ async def detach_from_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -478,7 +478,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -567,7 +567,7 @@ async def get_entity_state_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -636,7 +636,7 @@ async def get_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -706,7 +706,7 @@ async def assign_to_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -781,7 +781,7 @@ async def detach_from_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -855,7 +855,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -944,7 +944,7 @@ async def get_entity_state_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1013,7 +1013,7 @@ async def get_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1083,7 +1083,7 @@ async def assign_to_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1155,7 +1155,7 @@ async def detach_from_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1229,7 +1229,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1315,7 +1315,7 @@ async def get_entity_state( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1379,7 +1379,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1451,7 +1451,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1535,7 +1535,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1610,7 +1610,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py index dc5961fe8ca6..f66be3be5052 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py @@ -86,7 +86,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py index 323305584f7e..4abc9aeb96f5 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py @@ -40,71 +40,6 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def get( - self, - resource_group_name: str, - service_name: str, - access_name: Union[str, "_models.AccessIdName"], - **kwargs - ) -> "_models.AccessInformationContract": - """Gets the Git access configuration for the tenant. Without secrets. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param service_name: The name of the API Management service. - :type service_name: str - :param access_name: The identifier of the Access configuration. - :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessInformationContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'accessName': self._serialize.url("access_name", access_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['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - 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(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('AccessInformationContract', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git'} # type: ignore - async def regenerate_primary_key( self, resource_group_name: str, @@ -130,7 +65,7 @@ async def regenerate_primary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -190,7 +125,7 @@ async def regenerate_secondary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -224,68 +159,3 @@ async def regenerate_secondary_key( return cls(pipeline_response, None, {}) regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'} # type: ignore - - async def list_secrets( - self, - resource_group_name: str, - service_name: str, - access_name: Union[str, "_models.AccessIdName"], - **kwargs - ) -> "_models.AccessInformationContract": - """Gets the Git access configuration for the tenant. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param service_name: The name of the API Management service. - :type service_name: str - :param access_name: The identifier of the Access configuration. - :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessInformationContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_secrets.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'accessName': self._serialize.url("access_name", access_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['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - 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(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('AccessInformationContract', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/listSecrets'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py index a01d0474c020..d69fb1916d9a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py @@ -5,9 +5,10 @@ # 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, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings +from azure.core.async_paging import AsyncItemPaged, AsyncList 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 @@ -40,6 +41,86 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config + def list_by_service( + self, + resource_group_name: str, + service_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.AccessInformationCollection"]: + """Returns list of access infos - for Git and Management endpoints. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: Not used. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccessInformationCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.AccessInformationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('AccessInformationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant'} # type: ignore + async def get_entity_tag( self, resource_group_name: str, @@ -65,7 +146,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -129,7 +210,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -169,6 +250,84 @@ async def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + async def create( + self, + resource_group_name: str, + service_name: str, + access_name: Union[str, "_models.AccessIdName"], + if_match: str, + parameters: "_models.AccessInformationCreateParameters", + **kwargs + ) -> "_models.AccessInformationContract": + """Update tenant access information details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param access_name: The identifier of the Access configuration. + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName + :param if_match: ETag of the Entity. ETag should match the current entity state from the header + response of the GET request or it should be * for unconditional update. + :type if_match: str + :param parameters: Parameters supplied to retrieve the Tenant Access Information. + :type parameters: ~azure.mgmt.apimanagement.models.AccessInformationCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessInformationContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'accessName': self._serialize.url("access_name", access_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'AccessInformationCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('AccessInformationContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + async def update( self, resource_group_name: str, @@ -201,7 +360,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -272,7 +431,7 @@ async def regenerate_primary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -332,7 +491,7 @@ async def regenerate_secondary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -373,7 +532,7 @@ async def list_secrets( service_name: str, access_name: Union[str, "_models.AccessIdName"], **kwargs - ) -> "_models.AccessInformationContract": + ) -> "_models.AccessInformationSecretsContract": """Get tenant access information details. :param resource_group_name: The name of the resource group. @@ -383,16 +542,16 @@ async def list_secrets( :param access_name: The identifier of the Access configuration. :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessInformationContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract + :return: AccessInformationSecretsContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationSecretsContract :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationSecretsContract"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -424,7 +583,7 @@ async def list_secrets( response_headers = {} response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('AccessInformationContract', pipeline_response) + deserialized = self._deserialize('AccessInformationSecretsContract', pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py index 8d91f41bbf19..93101fb0d039 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py @@ -55,7 +55,7 @@ async def _deploy_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -190,7 +190,7 @@ async def _save_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -325,7 +325,7 @@ async def _validate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -473,7 +473,7 @@ async def get_sync_state( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -500,7 +500,8 @@ async def get_sync_state( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('TenantConfigurationSyncStateContract', pipeline_response) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py new file mode 100644 index 000000000000..11c4f90375d3 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py @@ -0,0 +1,187 @@ +# 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, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +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 TenantSettingsOperations: + """TenantSettingsOperations 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.apimanagement.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 + + def list_by_service( + self, + resource_group_name: str, + service_name: str, + filter: Optional[str] = None, + **kwargs + ) -> AsyncIterable["_models.TenantSettingsCollection"]: + """Public settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: Not used. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TenantSettingsCollection or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TenantSettingsCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('TenantSettingsCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings'} # type: ignore + + async def get( + self, + resource_group_name: str, + service_name: str, + settings_type: Union[str, "_models.SettingsTypeName"], + **kwargs + ) -> "_models.TenantSettingsContract": + """Get tenant settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param settings_type: The identifier of the settings. + :type settings_type: str or ~azure.mgmt.apimanagement.models.SettingsTypeName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TenantSettingsContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.TenantSettingsContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'settingsType': self._serialize.url("settings_type", settings_type, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('TenantSettingsContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py index 83dc308c62b0..411be604d90d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py @@ -69,7 +69,7 @@ async def send( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py index 2a64b827ead5..bcc3796d7d1c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py @@ -81,7 +81,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py index e23eac90403c..62565b808a51 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py @@ -66,7 +66,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py index eac0bf92cddc..edd45048c8ee 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py @@ -83,7 +83,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -169,7 +169,7 @@ async def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -233,7 +233,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -308,7 +308,7 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -394,7 +394,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -479,7 +479,7 @@ async def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -547,7 +547,7 @@ async def generate_sso_url( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -613,7 +613,7 @@ async def get_shared_access_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py index a4f0cf2c94d5..8fe578e64424 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py @@ -84,7 +84,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -143,3 +143,73 @@ async def get_next(next_link=None): get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions'} # type: ignore + + async def get( + self, + resource_group_name: str, + service_name: str, + user_id: str, + sid: str, + **kwargs + ) -> "_models.SubscriptionContract": + """Gets the specified Subscription entity associated with a particular user. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param user_id: User identifier. Must be unique in the current API Management service instance. + :type user_id: str + :param sid: Subscription entity Identifier. The entity represents the association between a + user and a product in API Management. + :type sid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'userId': self._serialize.url("user_id", user_id, 'str', max_length=80, min_length=1), + 'sid': self._serialize.url("sid", sid, 'str', max_length=256, min_length=0, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('SubscriptionContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index ce9a082a6f4f..e329c40fad4e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py @@ -7,7 +7,10 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AccessInformationCollection from ._models_py3 import AccessInformationContract + from ._models_py3 import AccessInformationCreateParameters + from ._models_py3 import AccessInformationSecretsContract from ._models_py3 import AccessInformationUpdateParameters from ._models_py3 import AdditionalLocation from ._models_py3 import ApiCollection @@ -24,6 +27,7 @@ from ._models_py3 import ApiManagementServiceBackupRestoreParameters from ._models_py3 import ApiManagementServiceBaseProperties from ._models_py3 import ApiManagementServiceCheckNameAvailabilityParameters + from ._models_py3 import ApiManagementServiceGetDomainOwnershipIdentifierResult from ._models_py3 import ApiManagementServiceGetSsoTokenResult from ._models_py3 import ApiManagementServiceIdentity from ._models_py3 import ApiManagementServiceListResult @@ -33,6 +37,15 @@ from ._models_py3 import ApiManagementServiceSkuProperties from ._models_py3 import ApiManagementServiceUpdateParameters from ._models_py3 import ApiManagementServiceUpdateProperties + from ._models_py3 import ApiManagementSku + from ._models_py3 import ApiManagementSkuCapabilities + from ._models_py3 import ApiManagementSkuCapacity + from ._models_py3 import ApiManagementSkuCosts + from ._models_py3 import ApiManagementSkuLocationInfo + from ._models_py3 import ApiManagementSkuRestrictionInfo + from ._models_py3 import ApiManagementSkuRestrictions + from ._models_py3 import ApiManagementSkuZoneDetails + from ._models_py3 import ApiManagementSkusResult from ._models_py3 import ApiReleaseCollection from ._models_py3 import ApiReleaseContract from ._models_py3 import ApiRevisionCollection @@ -100,6 +113,8 @@ from ._models_py3 import ErrorFieldContract from ._models_py3 import ErrorResponse from ._models_py3 import ErrorResponseBody + from ._models_py3 import GatewayCertificateAuthorityCollection + from ._models_py3 import GatewayCertificateAuthorityContract from ._models_py3 import GatewayCollection from ._models_py3 import GatewayContract from ._models_py3 import GatewayHostnameConfigurationCollection @@ -180,6 +195,8 @@ from ._models_py3 import PortalRevisionCollection from ._models_py3 import PortalRevisionContract from ._models_py3 import PortalSettingValidationKeyContract + from ._models_py3 import PortalSettingsCollection + from ._models_py3 import PortalSettingsContract from ._models_py3 import PortalSigninSettings from ._models_py3 import PortalSignupSettings from ._models_py3 import ProductCollection @@ -238,6 +255,8 @@ from ._models_py3 import TagResourceContract from ._models_py3 import TagResourceContractProperties from ._models_py3 import TenantConfigurationSyncStateContract + from ._models_py3 import TenantSettingsCollection + from ._models_py3 import TenantSettingsContract from ._models_py3 import TermsOfServiceProperties from ._models_py3 import TokenBodyParameterContract from ._models_py3 import UserCollection @@ -256,7 +275,10 @@ from ._models_py3 import VirtualNetworkConfiguration from ._models_py3 import X509CertificateName except (SyntaxError, ImportError): + from ._models import AccessInformationCollection # type: ignore from ._models import AccessInformationContract # type: ignore + from ._models import AccessInformationCreateParameters # type: ignore + from ._models import AccessInformationSecretsContract # type: ignore from ._models import AccessInformationUpdateParameters # type: ignore from ._models import AdditionalLocation # type: ignore from ._models import ApiCollection # type: ignore @@ -273,6 +295,7 @@ from ._models import ApiManagementServiceBackupRestoreParameters # type: ignore from ._models import ApiManagementServiceBaseProperties # type: ignore from ._models import ApiManagementServiceCheckNameAvailabilityParameters # type: ignore + from ._models import ApiManagementServiceGetDomainOwnershipIdentifierResult # type: ignore from ._models import ApiManagementServiceGetSsoTokenResult # type: ignore from ._models import ApiManagementServiceIdentity # type: ignore from ._models import ApiManagementServiceListResult # type: ignore @@ -282,6 +305,15 @@ from ._models import ApiManagementServiceSkuProperties # type: ignore from ._models import ApiManagementServiceUpdateParameters # type: ignore from ._models import ApiManagementServiceUpdateProperties # type: ignore + from ._models import ApiManagementSku # type: ignore + from ._models import ApiManagementSkuCapabilities # type: ignore + from ._models import ApiManagementSkuCapacity # type: ignore + from ._models import ApiManagementSkuCosts # type: ignore + from ._models import ApiManagementSkuLocationInfo # type: ignore + from ._models import ApiManagementSkuRestrictionInfo # type: ignore + from ._models import ApiManagementSkuRestrictions # type: ignore + from ._models import ApiManagementSkuZoneDetails # type: ignore + from ._models import ApiManagementSkusResult # type: ignore from ._models import ApiReleaseCollection # type: ignore from ._models import ApiReleaseContract # type: ignore from ._models import ApiRevisionCollection # type: ignore @@ -349,6 +381,8 @@ from ._models import ErrorFieldContract # type: ignore from ._models import ErrorResponse # type: ignore from ._models import ErrorResponseBody # type: ignore + from ._models import GatewayCertificateAuthorityCollection # type: ignore + from ._models import GatewayCertificateAuthorityContract # type: ignore from ._models import GatewayCollection # type: ignore from ._models import GatewayContract # type: ignore from ._models import GatewayHostnameConfigurationCollection # type: ignore @@ -429,6 +463,8 @@ from ._models import PortalRevisionCollection # type: ignore from ._models import PortalRevisionContract # type: ignore from ._models import PortalSettingValidationKeyContract # type: ignore + from ._models import PortalSettingsCollection # type: ignore + from ._models import PortalSettingsContract # type: ignore from ._models import PortalSigninSettings # type: ignore from ._models import PortalSignupSettings # type: ignore from ._models import ProductCollection # type: ignore @@ -487,6 +523,8 @@ from ._models import TagResourceContract # type: ignore from ._models import TagResourceContractProperties # type: ignore from ._models import TenantConfigurationSyncStateContract # type: ignore + from ._models import TenantSettingsCollection # type: ignore + from ._models import TenantSettingsContract # type: ignore from ._models import TermsOfServiceProperties # type: ignore from ._models import TokenBodyParameterContract # type: ignore from ._models import UserCollection # type: ignore @@ -508,6 +546,9 @@ from ._api_management_client_enums import ( AccessIdName, AlwaysLog, + ApiManagementSkuCapacityScaleType, + ApiManagementSkuRestrictionsReasonCode, + ApiManagementSkuRestrictionsType, ApiType, ApiVersionSetContractDetailsVersioningScheme, ApimIdentityType, @@ -546,6 +587,7 @@ Protocol, ResourceSkuCapacityScaleType, SamplingType, + SettingsTypeName, SkuType, SoapApiType, State, @@ -558,7 +600,10 @@ ) __all__ = [ + 'AccessInformationCollection', 'AccessInformationContract', + 'AccessInformationCreateParameters', + 'AccessInformationSecretsContract', 'AccessInformationUpdateParameters', 'AdditionalLocation', 'ApiCollection', @@ -575,6 +620,7 @@ 'ApiManagementServiceBackupRestoreParameters', 'ApiManagementServiceBaseProperties', 'ApiManagementServiceCheckNameAvailabilityParameters', + 'ApiManagementServiceGetDomainOwnershipIdentifierResult', 'ApiManagementServiceGetSsoTokenResult', 'ApiManagementServiceIdentity', 'ApiManagementServiceListResult', @@ -584,6 +630,15 @@ 'ApiManagementServiceSkuProperties', 'ApiManagementServiceUpdateParameters', 'ApiManagementServiceUpdateProperties', + 'ApiManagementSku', + 'ApiManagementSkuCapabilities', + 'ApiManagementSkuCapacity', + 'ApiManagementSkuCosts', + 'ApiManagementSkuLocationInfo', + 'ApiManagementSkuRestrictionInfo', + 'ApiManagementSkuRestrictions', + 'ApiManagementSkuZoneDetails', + 'ApiManagementSkusResult', 'ApiReleaseCollection', 'ApiReleaseContract', 'ApiRevisionCollection', @@ -651,6 +706,8 @@ 'ErrorFieldContract', 'ErrorResponse', 'ErrorResponseBody', + 'GatewayCertificateAuthorityCollection', + 'GatewayCertificateAuthorityContract', 'GatewayCollection', 'GatewayContract', 'GatewayHostnameConfigurationCollection', @@ -731,6 +788,8 @@ 'PortalRevisionCollection', 'PortalRevisionContract', 'PortalSettingValidationKeyContract', + 'PortalSettingsCollection', + 'PortalSettingsContract', 'PortalSigninSettings', 'PortalSignupSettings', 'ProductCollection', @@ -789,6 +848,8 @@ 'TagResourceContract', 'TagResourceContractProperties', 'TenantConfigurationSyncStateContract', + 'TenantSettingsCollection', + 'TenantSettingsContract', 'TermsOfServiceProperties', 'TokenBodyParameterContract', 'UserCollection', @@ -808,6 +869,9 @@ 'X509CertificateName', 'AccessIdName', 'AlwaysLog', + 'ApiManagementSkuCapacityScaleType', + 'ApiManagementSkuRestrictionsReasonCode', + 'ApiManagementSkuRestrictionsType', 'ApiType', 'ApiVersionSetContractDetailsVersioningScheme', 'ApimIdentityType', @@ -846,6 +910,7 @@ 'Protocol', 'ResourceSkuCapacityScaleType', 'SamplingType', + 'SettingsTypeName', 'SkuType', 'SoapApiType', 'State', diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py index 4b15e74c2c0a..a82fada00c3c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_api_management_client_enums.py @@ -29,6 +29,7 @@ def __getattr__(cls, name): class AccessIdName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ACCESS = "access" + GIT_ACCESS = "gitAccess" class AlwaysLog(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies for what type of messages sampling settings should not apply. @@ -36,6 +37,28 @@ class AlwaysLog(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ALL_ERRORS = "allErrors" #: Always log all erroneous request regardless of sampling settings. +class ApiManagementSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The scale type applicable to the sku. + """ + + AUTOMATIC = "Automatic" + MANUAL = "Manual" + NONE = "None" + +class ApiManagementSkuRestrictionsReasonCode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The reason for restriction. + """ + + QUOTA_ID = "QuotaId" + NOT_AVAILABLE_FOR_SUBSCRIPTION = "NotAvailableForSubscription" + +class ApiManagementSkuRestrictionsType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of restrictions. + """ + + LOCATION = "Location" + ZONE = "Zone" + class ApimIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will @@ -55,7 +78,7 @@ class ApiType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SOAP = "soap" class ApiVersionSetContractDetailsVersioningScheme(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """An value that determines where the API Version identifer will be located in a HTTP request. + """An value that determines where the API Version identifier will be located in a HTTP request. """ SEGMENT = "Segment" @@ -329,6 +352,10 @@ class SamplingType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): FIXED = "fixed" #: Fixed-rate sampling. +class SettingsTypeName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + + PUBLIC = "public" + class SkuType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Name of the Sku. """ @@ -413,7 +440,7 @@ class Verbosity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ERROR = "error" #: Only traces with 'severity' set to 'error' will be sent to the logger attached to this diagnostic instance. class VersioningScheme(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """An value that determines where the API Version identifer will be located in a HTTP request. + """An value that determines where the API Version identifier will be located in a HTTP request. """ SEGMENT = "Segment" #: The API Version is passed in a path segment. diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py index c6cea410e995..46b0504cf0b1 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models.py @@ -10,11 +10,159 @@ import msrest.serialization -class AccessInformationContract(msrest.serialization.Model): +class AccessInformationCollection(msrest.serialization.Model): + """Paged AccessInformation list representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Page values. + :vartype value: list[~azure.mgmt.apimanagement.models.AccessInformationContract] + :param count: Total record count number across all pages. + :type count: long + :ivar next_link: Next page link if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AccessInformationContract]'}, + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessInformationCollection, self).__init__(**kwargs) + self.value = None + self.count = kwargs.get('count', None) + self.next_link = None + + +class Resource(msrest.serialization.Model): + """The Resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessInformationContract(Resource): + """Tenant Settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param id_properties_id: Access Information type ('access' or 'gitAccess'). + :type id_properties_id: str + :param principal_id: Principal (User) Identifier. + :type principal_id: str + :param enabled: Determines whether direct access is enabled. + :type enabled: bool + """ + + _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'}, + 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessInformationContract, self).__init__(**kwargs) + self.id_properties_id = kwargs.get('id_properties_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.enabled = kwargs.get('enabled', None) + + +class AccessInformationCreateParameters(msrest.serialization.Model): + """Tenant access information update parameters. + + :param principal_id: Principal (User) Identifier. + :type principal_id: str + :param primary_key: Primary access key. This property will not be filled on 'GET' operations! + Use '/listSecrets' POST request to get the value. + :type primary_key: str + :param secondary_key: Secondary access key. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. + :type secondary_key: str + :param enabled: Determines whether direct access is enabled. + :type enabled: bool + """ + + _attribute_map = { + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(AccessInformationCreateParameters, self).__init__(**kwargs) + self.principal_id = kwargs.get('principal_id', None) + self.primary_key = kwargs.get('primary_key', None) + self.secondary_key = kwargs.get('secondary_key', None) + self.enabled = kwargs.get('enabled', None) + + +class AccessInformationSecretsContract(msrest.serialization.Model): """Tenant access information contract of the API Management service. - :param id: Identifier. + :param id: Access Information type ('access' or 'gitAccess'). :type id: str + :param principal_id: Principal (User) Identifier. + :type principal_id: str :param primary_key: Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. :type primary_key: str @@ -27,6 +175,7 @@ class AccessInformationContract(msrest.serialization.Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, 'primary_key': {'key': 'primaryKey', 'type': 'str'}, 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, @@ -36,8 +185,9 @@ def __init__( self, **kwargs ): - super(AccessInformationContract, self).__init__(**kwargs) + super(AccessInformationSecretsContract, self).__init__(**kwargs) self.id = kwargs.get('id', None) + self.principal_id = kwargs.get('principal_id', None) self.primary_key = kwargs.get('primary_key', None) self.secondary_key = kwargs.get('secondary_key', None) self.enabled = kwargs.get('enabled', None) @@ -135,6 +285,8 @@ class ApiCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.ApiContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -146,6 +298,7 @@ class ApiCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[ApiContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -155,44 +308,10 @@ def __init__( ): super(ApiCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None -class Resource(msrest.serialization.Model): - """The Resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type for API Management resource. - :vartype type: str - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - class ApiContract(Resource): """Api details. @@ -1134,6 +1253,31 @@ def __init__( self.name = kwargs['name'] +class ApiManagementServiceGetDomainOwnershipIdentifierResult(msrest.serialization.Model): + """Response of the GetDomainOwnershipIdentifier operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar domain_ownership_identifier: The domain ownership identifier value. + :vartype domain_ownership_identifier: str + """ + + _validation = { + 'domain_ownership_identifier': {'readonly': True}, + } + + _attribute_map = { + 'domain_ownership_identifier': {'key': 'domainOwnershipIdentifier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementServiceGetDomainOwnershipIdentifierResult, self).__init__(**kwargs) + self.domain_ownership_identifier = None + + class ApiManagementServiceGetSsoTokenResult(msrest.serialization.Model): """The response of the GetSsoToken operation. @@ -2074,6 +2218,373 @@ def __init__( self.publisher_name = kwargs.get('publisher_name', None) +class ApiManagementSku(msrest.serialization.Model): + """Describes an available ApiManagement SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of virtual machines in a scale set.:code:`
`:code:`
` + Possible Values::code:`
`:code:`
` **Standard**\ :code:`
`:code:`
` + **Basic**. + :vartype tier: str + :ivar size: The Size of the SKU. + :vartype size: str + :ivar family: The Family of this particular SKU. + :vartype family: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.apimanagement.models.ApiManagementSkuCapacity + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: list[~azure.mgmt.apimanagement.models.ApiManagementSkuLocationInfo] + :ivar api_versions: The api versions that support this SKU. + :vartype api_versions: list[str] + :ivar costs: Metadata for retrieving price info. + :vartype costs: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCosts] + :ivar capabilities: A name value pair to describe the capability. + :vartype capabilities: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCapabilities] + :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :vartype restrictions: list[~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'kind': {'readonly': True}, + 'capacity': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'costs': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ApiManagementSkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ApiManagementSkuLocationInfo]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'costs': {'key': 'costs', 'type': '[ApiManagementSkuCosts]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ApiManagementSkuCapabilities]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ApiManagementSkuRestrictions]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.size = None + self.family = None + self.kind = None + self.capacity = None + self.locations = None + self.location_info = None + self.api_versions = None + self.costs = None + self.capabilities = None + self.restrictions = None + + +class ApiManagementSkuCapabilities(msrest.serialization.Model): + """Describes The SKU capabilities object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuCapabilities, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ApiManagementSkuCapacity(msrest.serialization.Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: int + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: int + :ivar default: The default capacity. + :vartype default: int + :ivar scale_type: The scale type applicable to the sku. Possible values include: "Automatic", + "Manual", "None". + :vartype scale_type: str or ~azure.mgmt.apimanagement.models.ApiManagementSkuCapacityScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class ApiManagementSkuCosts(msrest.serialization.Model): + """Describes metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The multiplier is needed to extend the base metered cost. + :vartype quantity: long + :ivar extended_unit: An invariant to show the extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterID', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuCosts, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class ApiManagementSkuLocationInfo(msrest.serialization.Model): + """ApiManagementSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.apimanagement.models.ApiManagementSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ApiManagementSkuZoneDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ApiManagementSkuRestrictionInfo(msrest.serialization.Model): + """ApiManagementSkuRestrictionInfo. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: Locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ApiManagementSkuRestrictions(msrest.serialization.Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. Possible values include: "Location", "Zone". + :vartype type: str or ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the SKU cannot be used. + :vartype restriction_info: ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: "QuotaId", + "NotAvailableForSubscription". + :vartype reason_code: str or + ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ApiManagementSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ApiManagementSkusResult(msrest.serialization.Model): + """The List Resource Skus operation response. + + 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. + + :param value: Required. The list of skus available for the subscription. + :type value: list[~azure.mgmt.apimanagement.models.ApiManagementSku] + :ivar next_link: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI + to fetch the next page of Resource Skus. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApiManagementSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkusResult, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = None + + +class ApiManagementSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCapabilities] + """ + + _validation = { + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ApiManagementSkuCapabilities]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + class ApiReleaseCollection(msrest.serialization.Model): """Paged ApiRelease list representation. @@ -2081,6 +2592,8 @@ class ApiReleaseCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.ApiReleaseContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -2092,6 +2605,7 @@ class ApiReleaseCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[ApiReleaseContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -2101,6 +2615,7 @@ def __init__( ): super(ApiReleaseCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -2162,6 +2677,8 @@ class ApiRevisionCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.ApiRevisionContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -2173,6 +2690,7 @@ class ApiRevisionCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[ApiRevisionContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -2182,6 +2700,7 @@ def __init__( ): super(ApiRevisionCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -2494,12 +3013,15 @@ class ApiVersionSetCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.ApiVersionSetContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[ApiVersionSetContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -2509,6 +3031,7 @@ def __init__( ): super(ApiVersionSetCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -2533,7 +3056,7 @@ class ApiVersionSetContract(Resource): :type version_header_name: str :param display_name: Name of API Version Set. :type display_name: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -2580,7 +3103,7 @@ class ApiVersionSetContractDetails(msrest.serialization.Model): :type name: str :param description: Description of API Version Set. :type description: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetailsVersioningScheme @@ -2663,7 +3186,7 @@ class ApiVersionSetContractProperties(ApiVersionSetEntityBase): :type version_header_name: str :param display_name: Required. Name of API Version Set. :type display_name: str - :param versioning_scheme: Required. An value that determines where the API Version identifer + :param versioning_scheme: Required. An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -2705,7 +3228,7 @@ class ApiVersionSetUpdateParameters(msrest.serialization.Model): :type version_header_name: str :param display_name: Name of API Version Set. :type display_name: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -2749,7 +3272,7 @@ class ApiVersionSetUpdateParametersProperties(ApiVersionSetEntityBase): :type version_header_name: str :param display_name: Name of API Version Set. :type display_name: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -3479,12 +4002,15 @@ class BackendCollection(msrest.serialization.Model): :param value: Backend values. :type value: list[~azure.mgmt.apimanagement.models.BackendContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[BackendContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -3494,6 +4020,7 @@ def __init__( ): super(BackendCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -3629,7 +4156,10 @@ def __init__( class BackendCredentialsContract(msrest.serialization.Model): """Details of the Credentials used to connect to Backend. - :param certificate: List of Client Certificate Thumbprint. + :param certificate_ids: List of Client Certificate Ids. + :type certificate_ids: list[str] + :param certificate: List of Client Certificate Thumbprints. Will be ignored if certificatesIds + are provided. :type certificate: list[str] :param query: Query Parameter description. :type query: dict[str, list[str]] @@ -3640,10 +4170,12 @@ class BackendCredentialsContract(msrest.serialization.Model): """ _validation = { + 'certificate_ids': {'max_items': 32, 'min_items': 0}, 'certificate': {'max_items': 32, 'min_items': 0}, } _attribute_map = { + 'certificate_ids': {'key': 'certificateIds', 'type': '[str]'}, 'certificate': {'key': 'certificate', 'type': '[str]'}, 'query': {'key': 'query', 'type': '{[str]}'}, 'header': {'key': 'header', 'type': '{[str]}'}, @@ -3655,6 +4187,7 @@ def __init__( **kwargs ): super(BackendCredentialsContract, self).__init__(**kwargs) + self.certificate_ids = kwargs.get('certificate_ids', None) self.certificate = kwargs.get('certificate', None) self.query = kwargs.get('query', None) self.header = kwargs.get('header', None) @@ -3757,8 +4290,10 @@ class BackendServiceFabricClusterProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_certificatethumbprint: Required. The client certificate thumbprint for the - management endpoint. + :param client_certificate_id: The client certificate id for the management endpoint. + :type client_certificate_id: str + :param client_certificatethumbprint: The client certificate thumbprint for the management + endpoint. Will be ignored if certificatesIds are provided. :type client_certificatethumbprint: str :param max_partition_resolution_retries: Maximum number of retries while attempting resolve the partition. @@ -3773,11 +4308,11 @@ class BackendServiceFabricClusterProperties(msrest.serialization.Model): """ _validation = { - 'client_certificatethumbprint': {'required': True}, 'management_endpoints': {'required': True}, } _attribute_map = { + 'client_certificate_id': {'key': 'clientCertificateId', 'type': 'str'}, 'client_certificatethumbprint': {'key': 'clientCertificatethumbprint', 'type': 'str'}, 'max_partition_resolution_retries': {'key': 'maxPartitionResolutionRetries', 'type': 'int'}, 'management_endpoints': {'key': 'managementEndpoints', 'type': '[str]'}, @@ -3790,7 +4325,8 @@ def __init__( **kwargs ): super(BackendServiceFabricClusterProperties, self).__init__(**kwargs) - self.client_certificatethumbprint = kwargs['client_certificatethumbprint'] + self.client_certificate_id = kwargs.get('client_certificate_id', None) + self.client_certificatethumbprint = kwargs.get('client_certificatethumbprint', None) self.max_partition_resolution_retries = kwargs.get('max_partition_resolution_retries', None) self.management_endpoints = kwargs['management_endpoints'] self.server_certificate_thumbprints = kwargs.get('server_certificate_thumbprints', None) @@ -3961,12 +4497,15 @@ class CacheCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.CacheContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[CacheContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -3976,6 +4515,7 @@ def __init__( ): super(CacheCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -4076,12 +4616,15 @@ class CertificateCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.CertificateContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[CertificateContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -4091,6 +4634,7 @@ def __init__( ): super(CertificateCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -4632,12 +5176,15 @@ class DiagnosticCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.DiagnosticContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[DiagnosticContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -4647,6 +5194,7 @@ def __init__( ): super(DiagnosticCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -4728,12 +5276,15 @@ class EmailTemplateCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.EmailTemplateContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[EmailTemplateContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -4743,6 +5294,7 @@ def __init__( ): super(EmailTemplateCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -4930,38 +5482,104 @@ def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class ErrorResponseBody(msrest.serialization.Model): + """Error Body contract. + + :param code: Service-defined error code. This code serves as a sub-status for the HTTP error + code specified in the response. + :type code: str + :param message: Human-readable representation of the error. + :type message: str + :param details: The list of invalid fields send in request, in case of validation error. + :type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__( + self, + **kwargs + ): + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.details = kwargs.get('details', None) + + +class GatewayCertificateAuthorityCollection(msrest.serialization.Model): + """Paged Gateway certificate authority list representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Page values. + :vartype value: list[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract] + :ivar next_link: Next page link if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayCertificateAuthorityContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GatewayCertificateAuthorityCollection, self).__init__(**kwargs) + self.value = None + self.next_link = None -class ErrorResponseBody(msrest.serialization.Model): - """Error Body contract. +class GatewayCertificateAuthorityContract(Resource): + """Gateway certificate authority details. - :param code: Service-defined error code. This code serves as a sub-status for the HTTP error - code specified in the response. - :type code: str - :param message: Human-readable representation of the error. - :type message: str - :param details: The list of invalid fields send in request, in case of validation error. - :type details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param is_trusted: Determines whether certificate authority is trusted. + :type is_trusted: bool """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'is_trusted': {'key': 'properties.isTrusted', 'type': 'bool'}, } def __init__( self, **kwargs ): - super(ErrorResponseBody, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) - self.details = kwargs.get('details', None) + super(GatewayCertificateAuthorityContract, self).__init__(**kwargs) + self.is_trusted = kwargs.get('is_trusted', None) class GatewayCollection(msrest.serialization.Model): @@ -4971,6 +5589,8 @@ class GatewayCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.GatewayContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -4982,6 +5602,7 @@ class GatewayCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[GatewayContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -4991,6 +5612,7 @@ def __init__( ): super(GatewayCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -5247,12 +5869,15 @@ class GroupCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.GroupContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[GroupContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -5262,6 +5887,7 @@ def __init__( ): super(GroupCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -5908,12 +6534,15 @@ class IdentityProviderList(msrest.serialization.Model): :param value: Identity Provider configuration values. :type value: list[~azure.mgmt.apimanagement.models.IdentityProviderContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[IdentityProviderContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -5923,6 +6552,7 @@ def __init__( ): super(IdentityProviderList, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -6067,6 +6697,8 @@ class IssueAttachmentCollection(msrest.serialization.Model): :ivar value: Issue Attachment values. :vartype value: list[~azure.mgmt.apimanagement.models.IssueAttachmentContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -6078,6 +6710,7 @@ class IssueAttachmentCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[IssueAttachmentContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -6087,6 +6720,7 @@ def __init__( ): super(IssueAttachmentCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -6142,6 +6776,8 @@ class IssueCollection(msrest.serialization.Model): :ivar value: Issue values. :vartype value: list[~azure.mgmt.apimanagement.models.IssueContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -6153,6 +6789,7 @@ class IssueCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[IssueContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -6162,6 +6799,7 @@ def __init__( ): super(IssueCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -6172,6 +6810,8 @@ class IssueCommentCollection(msrest.serialization.Model): :ivar value: Issue Comment values. :vartype value: list[~azure.mgmt.apimanagement.models.IssueCommentContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -6183,6 +6823,7 @@ class IssueCommentCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[IssueCommentContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -6192,6 +6833,7 @@ def __init__( ): super(IssueCommentCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -6651,12 +7293,15 @@ class NamedValueCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.NamedValueContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[NamedValueContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -6666,6 +7311,7 @@ def __init__( ): super(NamedValueCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -7080,12 +7726,15 @@ class NotificationCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.NotificationContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[NotificationContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -7095,6 +7744,7 @@ def __init__( ): super(NotificationCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -7195,12 +7845,15 @@ class OpenIdConnectProviderCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.OpenidConnectProviderContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[OpenidConnectProviderContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -7210,6 +7863,7 @@ def __init__( ): super(OpenIdConnectProviderCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -7343,6 +7997,8 @@ class OperationCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.OperationContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -7354,6 +8010,7 @@ class OperationCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[OperationContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -7363,6 +8020,7 @@ def __init__( ): super(OperationCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -7902,12 +8560,15 @@ class PolicyCollection(msrest.serialization.Model): :param value: Policy Contract value. :type value: list[~azure.mgmt.apimanagement.models.PolicyContract] + :param count: Total record count number. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[PolicyContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -7917,6 +8578,7 @@ def __init__( ): super(PolicyCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -7998,7 +8660,7 @@ class PolicyDescriptionContract(Resource): :ivar description: Policy description. :vartype description: str :ivar scope: Binary OR value of the Snippet scope. - :vartype scope: int + :vartype scope: long """ _validation = { @@ -8014,7 +8676,7 @@ class PolicyDescriptionContract(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'int'}, + 'scope': {'key': 'properties.scope', 'type': 'long'}, } def __init__( @@ -8168,6 +8830,87 @@ def __init__( self.updated_date_time = None +class PortalSettingsCollection(msrest.serialization.Model): + """Descriptions of APIM policies. + + :param value: Descriptions of APIM policies. + :type value: list[~azure.mgmt.apimanagement.models.PortalSettingsContract] + :param count: Total record count number. + :type count: long + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PortalSettingsContract]'}, + 'count': {'key': 'count', 'type': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(PortalSettingsCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) + + +class PortalSettingsContract(Resource): + """Portal Settings for the Developer Portal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param url: A delegation Url. + :type url: str + :param validation_key: A base64-encoded validation key to validate, that a request is coming + from Azure API Management. + :type validation_key: str + :param subscriptions: Subscriptions delegation settings. + :type subscriptions: ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties + :param user_registration: User registration delegation settings. + :type user_registration: + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties + :param enabled: Redirect Anonymous users to the Sign-In page. + :type enabled: bool + :param terms_of_service: Terms of service contract properties. + :type terms_of_service: ~azure.mgmt.apimanagement.models.TermsOfServiceProperties + """ + + _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'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'validation_key': {'key': 'properties.validationKey', 'type': 'str'}, + 'subscriptions': {'key': 'properties.subscriptions', 'type': 'SubscriptionsDelegationSettingsProperties'}, + 'user_registration': {'key': 'properties.userRegistration', 'type': 'RegistrationDelegationSettingsProperties'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'terms_of_service': {'key': 'properties.termsOfService', 'type': 'TermsOfServiceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(PortalSettingsContract, self).__init__(**kwargs) + self.url = kwargs.get('url', None) + self.validation_key = kwargs.get('validation_key', None) + self.subscriptions = kwargs.get('subscriptions', None) + self.user_registration = kwargs.get('user_registration', None) + self.enabled = kwargs.get('enabled', None) + self.terms_of_service = kwargs.get('terms_of_service', None) + + class PortalSettingValidationKeyContract(msrest.serialization.Model): """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. @@ -8268,12 +9011,15 @@ class ProductCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.ProductContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[ProductContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -8283,6 +9029,7 @@ def __init__( ): super(ProductCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -8331,7 +9078,7 @@ class ProductContract(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -8394,7 +9141,7 @@ class ProductEntityBaseParameters(msrest.serialization.Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, } _attribute_map = { @@ -8455,7 +9202,7 @@ class ProductContractProperties(ProductEntityBaseParameters): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, } @@ -8515,7 +9262,7 @@ class ProductTagResourceContractProperties(ProductEntityBaseParameters): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'name': {'required': True, 'max_length': 300, 'min_length': 1}, } @@ -8573,7 +9320,7 @@ class ProductUpdateParameters(msrest.serialization.Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -8635,7 +9382,7 @@ class ProductUpdateProperties(ProductEntityBaseParameters): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -8805,12 +9552,15 @@ class RecipientEmailCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.RecipientEmailContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[RecipientEmailContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -8820,6 +9570,7 @@ def __init__( ): super(RecipientEmailCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -8887,12 +9638,15 @@ class RecipientUserCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.RecipientUserContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[RecipientUserContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -8902,6 +9656,7 @@ def __init__( ): super(RecipientUserCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -9642,6 +10397,8 @@ class SchemaCollection(msrest.serialization.Model): :ivar value: Api Schema Contract value. :vartype value: list[~azure.mgmt.apimanagement.models.SchemaContract] + :param count: Total record count number. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -9653,6 +10410,7 @@ class SchemaCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[SchemaContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -9662,6 +10420,7 @@ def __init__( ): super(SchemaCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -9720,12 +10479,15 @@ class SubscriptionCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.SubscriptionContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[SubscriptionContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -9735,6 +10497,7 @@ def __init__( ): super(SubscriptionCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -10050,12 +10813,15 @@ class TagCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.TagContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[TagContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -10065,6 +10831,7 @@ def __init__( ): super(TagCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -10164,12 +10931,15 @@ class TagDescriptionCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.TagDescriptionContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[TagDescriptionContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -10179,6 +10949,7 @@ def __init__( ): super(TagDescriptionCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -10309,12 +11080,15 @@ class TagResourceCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.TagResourceContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[TagResourceContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -10324,6 +11098,7 @@ def __init__( ): super(TagResourceCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) @@ -10438,6 +11213,72 @@ def __init__( self.configuration_change_date = kwargs.get('configuration_change_date', None) +class TenantSettingsCollection(msrest.serialization.Model): + """Paged AccessInformation list representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Page values. + :vartype value: list[~azure.mgmt.apimanagement.models.TenantSettingsContract] + :ivar next_link: Next page link if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TenantSettingsContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TenantSettingsCollection, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class TenantSettingsContract(Resource): + """Tenant Settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param settings: Tenant settings. + :type settings: dict[str, str] + """ + + _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'}, + 'settings': {'key': 'properties.settings', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + super(TenantSettingsContract, self).__init__(**kwargs) + self.settings = kwargs.get('settings', None) + + class TermsOfServiceProperties(msrest.serialization.Model): """Terms of service contract properties. @@ -10500,12 +11341,15 @@ class UserCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.UserContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[UserContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -10515,6 +11359,7 @@ def __init__( ): super(UserCollection, self).__init__(**kwargs) self.value = kwargs.get('value', None) + self.count = kwargs.get('count', None) self.next_link = kwargs.get('next_link', None) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py index 125d5cd5690d..91719343dd85 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py @@ -15,11 +15,170 @@ from ._api_management_client_enums import * -class AccessInformationContract(msrest.serialization.Model): +class AccessInformationCollection(msrest.serialization.Model): + """Paged AccessInformation list representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Page values. + :vartype value: list[~azure.mgmt.apimanagement.models.AccessInformationContract] + :param count: Total record count number across all pages. + :type count: long + :ivar next_link: Next page link if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[AccessInformationContract]'}, + 'count': {'key': 'count', 'type': 'long'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + count: Optional[int] = None, + **kwargs + ): + super(AccessInformationCollection, self).__init__(**kwargs) + self.value = None + self.count = count + self.next_link = None + + +class Resource(msrest.serialization.Model): + """The Resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + """ + + _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'}, + } + + def __init__( + self, + **kwargs + ): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class AccessInformationContract(Resource): + """Tenant Settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param id_properties_id: Access Information type ('access' or 'gitAccess'). + :type id_properties_id: str + :param principal_id: Principal (User) Identifier. + :type principal_id: str + :param enabled: Determines whether direct access is enabled. + :type enabled: bool + """ + + _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'}, + 'id_properties_id': {'key': 'properties.id', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + id_properties_id: Optional[str] = None, + principal_id: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(AccessInformationContract, self).__init__(**kwargs) + self.id_properties_id = id_properties_id + self.principal_id = principal_id + self.enabled = enabled + + +class AccessInformationCreateParameters(msrest.serialization.Model): + """Tenant access information update parameters. + + :param principal_id: Principal (User) Identifier. + :type principal_id: str + :param primary_key: Primary access key. This property will not be filled on 'GET' operations! + Use '/listSecrets' POST request to get the value. + :type primary_key: str + :param secondary_key: Secondary access key. This property will not be filled on 'GET' + operations! Use '/listSecrets' POST request to get the value. + :type secondary_key: str + :param enabled: Determines whether direct access is enabled. + :type enabled: bool + """ + + _attribute_map = { + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'primary_key': {'key': 'properties.primaryKey', 'type': 'str'}, + 'secondary_key': {'key': 'properties.secondaryKey', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__( + self, + *, + principal_id: Optional[str] = None, + primary_key: Optional[str] = None, + secondary_key: Optional[str] = None, + enabled: Optional[bool] = None, + **kwargs + ): + super(AccessInformationCreateParameters, self).__init__(**kwargs) + self.principal_id = principal_id + self.primary_key = primary_key + self.secondary_key = secondary_key + self.enabled = enabled + + +class AccessInformationSecretsContract(msrest.serialization.Model): """Tenant access information contract of the API Management service. - :param id: Identifier. + :param id: Access Information type ('access' or 'gitAccess'). :type id: str + :param principal_id: Principal (User) Identifier. + :type principal_id: str :param primary_key: Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. :type primary_key: str @@ -32,6 +191,7 @@ class AccessInformationContract(msrest.serialization.Model): _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, 'primary_key': {'key': 'primaryKey', 'type': 'str'}, 'secondary_key': {'key': 'secondaryKey', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, @@ -41,13 +201,15 @@ def __init__( self, *, id: Optional[str] = None, + principal_id: Optional[str] = None, primary_key: Optional[str] = None, secondary_key: Optional[str] = None, enabled: Optional[bool] = None, **kwargs ): - super(AccessInformationContract, self).__init__(**kwargs) + super(AccessInformationSecretsContract, self).__init__(**kwargs) self.id = id + self.principal_id = principal_id self.primary_key = primary_key self.secondary_key = secondary_key self.enabled = enabled @@ -153,6 +315,8 @@ class ApiCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.ApiContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -164,53 +328,22 @@ class ApiCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[ApiContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(ApiCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None -class Resource(msrest.serialization.Model): - """The Resource definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type for API Management resource. - :vartype type: str - """ - - _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'}, - } - - def __init__( - self, - **kwargs - ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - class ApiContract(Resource): """Api details. @@ -1290,6 +1423,31 @@ def __init__( self.name = name +class ApiManagementServiceGetDomainOwnershipIdentifierResult(msrest.serialization.Model): + """Response of the GetDomainOwnershipIdentifier operation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar domain_ownership_identifier: The domain ownership identifier value. + :vartype domain_ownership_identifier: str + """ + + _validation = { + 'domain_ownership_identifier': {'readonly': True}, + } + + _attribute_map = { + 'domain_ownership_identifier': {'key': 'domainOwnershipIdentifier', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementServiceGetDomainOwnershipIdentifierResult, self).__init__(**kwargs) + self.domain_ownership_identifier = None + + class ApiManagementServiceGetSsoTokenResult(msrest.serialization.Model): """The response of the GetSsoToken operation. @@ -2141,172 +2299,541 @@ def __init__( self.publisher_name = publisher_name -class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): - """Properties of an API Management service resource description. +class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): + """Properties of an API Management service resource description. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param notification_sender_email: Email address from which the notification will be sent. + :type notification_sender_email: str + :ivar provisioning_state: The current provisioning state of the API Management service which + can be one of the following: + Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. + :vartype provisioning_state: str + :ivar target_provisioning_state: The provisioning state of the API Management service, which is + targeted by the long running operation started on the service. + :vartype target_provisioning_state: str + :ivar created_at_utc: Creation UTC date of the API Management service.The date conforms to the + following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. + :vartype created_at_utc: ~datetime.datetime + :ivar gateway_url: Gateway URL of the API Management service. + :vartype gateway_url: str + :ivar gateway_regional_url: Gateway URL of the API Management service in the Default Region. + :vartype gateway_regional_url: str + :ivar portal_url: Publisher portal endpoint Url of the API Management service. + :vartype portal_url: str + :ivar management_api_url: Management API endpoint URL of the API Management service. + :vartype management_api_url: str + :ivar scm_url: SCM endpoint URL of the API Management service. + :vartype scm_url: str + :ivar developer_portal_url: DEveloper Portal endpoint URL of the API Management service. + :vartype developer_portal_url: str + :param hostname_configurations: Custom hostname configuration of the API Management service. + :type hostname_configurations: list[~azure.mgmt.apimanagement.models.HostnameConfiguration] + :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management + service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. + :vartype public_ip_addresses: list[str] + :ivar private_ip_addresses: Private Static Load Balanced IP addresses of the API Management + service in Primary region which is deployed in an Internal Virtual Network. Available only for + Basic, Standard, Premium and Isolated SKU. + :vartype private_ip_addresses: list[str] + :param virtual_network_configuration: Virtual network configuration of the API Management + service. + :type virtual_network_configuration: + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration + :param additional_locations: Additional datacenter locations of the API Management service. + :type additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] + :param custom_properties: Custom properties of the API Management service.
Setting + ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the + cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting + ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11`` can be used to + disable just TLS 1.1.
Setting + ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10`` can be used to + disable TLS 1.0 on an API Management service.
Setting + ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11`` can be used + to disable just TLS 1.1 for communications with backends.
Setting + ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10`` can be used + to disable TLS 1.0 for communications with backends.
Setting + ``Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2`` can be used to enable + HTTP2 protocol on an API Management service.
Not specifying any of these properties on + PATCH operation will reset omitted properties' values to their defaults. For all the settings + except Http2 the default value is ``True`` if the service was created on or before April 1st + 2018 and ``False`` otherwise. Http2 setting's default value is ``False``.

You can + disable any of next ciphers by using settings + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, + TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, + TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. + For example, + `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:\ + ``false``. The default value is ``true`` for them. Note: next ciphers can't be disabled since + they are required by Azure CloudService internal components: + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. + :type custom_properties: dict[str, str] + :param certificates: List of Certificates that need to be installed in the API Management + service. Max supported certificates that can be installed is 10. + :type certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] + :param enable_client_certificate: Property only meant to be used for Consumption SKU Service. + This enforces a client certificate to be presented on each request to the gateway. This also + enables the ability to authenticate the certificate in the policy on the gateway. + :type enable_client_certificate: bool + :param disable_gateway: Property only valid for an Api Management service deployed in multiple + locations. This can be used to disable the gateway in master region. + :type disable_gateway: bool + :param virtual_network_type: The type of VPN in which API Management service needs to be + configured in. None (Default Value) means the API Management service is not part of any Virtual + Network, External means the API Management deployment is set up inside a Virtual Network having + an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside + a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", + "External", "Internal". Default value: "None". + :type virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType + :param api_version_constraint: Control Plane Apis version constraint for the API Management + service. + :type api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint + :param restore: Undelete Api Management Service if it was previously soft-deleted. If this flag + is specified and set to True all other properties will be ignored. + :type restore: bool + :param publisher_email: Publisher email. + :type publisher_email: str + :param publisher_name: Publisher name. + :type publisher_name: str + """ + + _validation = { + 'notification_sender_email': {'max_length': 100, 'min_length': 0}, + 'provisioning_state': {'readonly': True}, + 'target_provisioning_state': {'readonly': True}, + 'created_at_utc': {'readonly': True}, + 'gateway_url': {'readonly': True}, + 'gateway_regional_url': {'readonly': True}, + 'portal_url': {'readonly': True}, + 'management_api_url': {'readonly': True}, + 'scm_url': {'readonly': True}, + 'developer_portal_url': {'readonly': True}, + 'public_ip_addresses': {'readonly': True}, + 'private_ip_addresses': {'readonly': True}, + 'publisher_email': {'max_length': 100, 'min_length': 0}, + 'publisher_name': {'max_length': 100, 'min_length': 0}, + } + + _attribute_map = { + 'notification_sender_email': {'key': 'notificationSenderEmail', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'target_provisioning_state': {'key': 'targetProvisioningState', 'type': 'str'}, + 'created_at_utc': {'key': 'createdAtUtc', 'type': 'iso-8601'}, + 'gateway_url': {'key': 'gatewayUrl', 'type': 'str'}, + 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, + 'portal_url': {'key': 'portalUrl', 'type': 'str'}, + 'management_api_url': {'key': 'managementApiUrl', 'type': 'str'}, + 'scm_url': {'key': 'scmUrl', 'type': 'str'}, + 'developer_portal_url': {'key': 'developerPortalUrl', 'type': 'str'}, + 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, + 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, + 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, + 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, + 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, + 'certificates': {'key': 'certificates', 'type': '[CertificateConfiguration]'}, + 'enable_client_certificate': {'key': 'enableClientCertificate', 'type': 'bool'}, + 'disable_gateway': {'key': 'disableGateway', 'type': 'bool'}, + 'virtual_network_type': {'key': 'virtualNetworkType', 'type': 'str'}, + 'api_version_constraint': {'key': 'apiVersionConstraint', 'type': 'ApiVersionConstraint'}, + 'restore': {'key': 'restore', 'type': 'bool'}, + 'publisher_email': {'key': 'publisherEmail', 'type': 'str'}, + 'publisher_name': {'key': 'publisherName', 'type': 'str'}, + } + + def __init__( + self, + *, + notification_sender_email: Optional[str] = None, + hostname_configurations: Optional[List["HostnameConfiguration"]] = None, + virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, + additional_locations: Optional[List["AdditionalLocation"]] = None, + custom_properties: Optional[Dict[str, str]] = None, + certificates: Optional[List["CertificateConfiguration"]] = None, + enable_client_certificate: Optional[bool] = False, + disable_gateway: Optional[bool] = False, + virtual_network_type: Optional[Union[str, "VirtualNetworkType"]] = "None", + api_version_constraint: Optional["ApiVersionConstraint"] = None, + restore: Optional[bool] = False, + publisher_email: Optional[str] = None, + publisher_name: Optional[str] = None, + **kwargs + ): + super(ApiManagementServiceUpdateProperties, self).__init__(notification_sender_email=notification_sender_email, hostname_configurations=hostname_configurations, virtual_network_configuration=virtual_network_configuration, additional_locations=additional_locations, custom_properties=custom_properties, certificates=certificates, enable_client_certificate=enable_client_certificate, disable_gateway=disable_gateway, virtual_network_type=virtual_network_type, api_version_constraint=api_version_constraint, restore=restore, **kwargs) + self.publisher_email = publisher_email + self.publisher_name = publisher_name + + +class ApiManagementSku(msrest.serialization.Model): + """Describes an available ApiManagement SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar resource_type: The type of resource the SKU applies to. + :vartype resource_type: str + :ivar name: The name of SKU. + :vartype name: str + :ivar tier: Specifies the tier of virtual machines in a scale set.:code:`
`:code:`
` + Possible Values::code:`
`:code:`
` **Standard**\ :code:`
`:code:`
` + **Basic**. + :vartype tier: str + :ivar size: The Size of the SKU. + :vartype size: str + :ivar family: The Family of this particular SKU. + :vartype family: str + :ivar kind: The Kind of resources that are supported in this SKU. + :vartype kind: str + :ivar capacity: Specifies the number of virtual machines in the scale set. + :vartype capacity: ~azure.mgmt.apimanagement.models.ApiManagementSkuCapacity + :ivar locations: The set of locations that the SKU is available. + :vartype locations: list[str] + :ivar location_info: A list of locations and availability zones in those locations where the + SKU is available. + :vartype location_info: list[~azure.mgmt.apimanagement.models.ApiManagementSkuLocationInfo] + :ivar api_versions: The api versions that support this SKU. + :vartype api_versions: list[str] + :ivar costs: Metadata for retrieving price info. + :vartype costs: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCosts] + :ivar capabilities: A name value pair to describe the capability. + :vartype capabilities: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCapabilities] + :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if + there are no restrictions. + :vartype restrictions: list[~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictions] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'tier': {'readonly': True}, + 'size': {'readonly': True}, + 'family': {'readonly': True}, + 'kind': {'readonly': True}, + 'capacity': {'readonly': True}, + 'locations': {'readonly': True}, + 'location_info': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'costs': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'size': {'key': 'size', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'capacity': {'key': 'capacity', 'type': 'ApiManagementSkuCapacity'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[ApiManagementSkuLocationInfo]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'costs': {'key': 'costs', 'type': '[ApiManagementSkuCosts]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ApiManagementSkuCapabilities]'}, + 'restrictions': {'key': 'restrictions', 'type': '[ApiManagementSkuRestrictions]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.tier = None + self.size = None + self.family = None + self.kind = None + self.capacity = None + self.locations = None + self.location_info = None + self.api_versions = None + self.costs = None + self.capabilities = None + self.restrictions = None + + +class ApiManagementSkuCapabilities(msrest.serialization.Model): + """Describes The SKU capabilities object. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: An invariant to describe the feature. + :vartype name: str + :ivar value: An invariant if the feature is measured by quantity. + :vartype value: str + """ + + _validation = { + 'name': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuCapabilities, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ApiManagementSkuCapacity(msrest.serialization.Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar minimum: The minimum capacity. + :vartype minimum: int + :ivar maximum: The maximum capacity that can be set. + :vartype maximum: int + :ivar default: The default capacity. + :vartype default: int + :ivar scale_type: The scale type applicable to the sku. Possible values include: "Automatic", + "Manual", "None". + :vartype scale_type: str or ~azure.mgmt.apimanagement.models.ApiManagementSkuCapacityScaleType + """ + + _validation = { + 'minimum': {'readonly': True}, + 'maximum': {'readonly': True}, + 'default': {'readonly': True}, + 'scale_type': {'readonly': True}, + } + + _attribute_map = { + 'minimum': {'key': 'minimum', 'type': 'int'}, + 'maximum': {'key': 'maximum', 'type': 'int'}, + 'default': {'key': 'default', 'type': 'int'}, + 'scale_type': {'key': 'scaleType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class ApiManagementSkuCosts(msrest.serialization.Model): + """Describes metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The multiplier is needed to extend the base metered cost. + :vartype quantity: long + :ivar extended_unit: An invariant to show the extended unit. + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterID', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuCosts, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class ApiManagementSkuLocationInfo(msrest.serialization.Model): + """ApiManagementSkuLocationInfo. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar location: Location of the SKU. + :vartype location: str + :ivar zones: List of availability zones where the SKU is supported. + :vartype zones: list[str] + :ivar zone_details: Details of capabilities available to a SKU in specific zones. + :vartype zone_details: list[~azure.mgmt.apimanagement.models.ApiManagementSkuZoneDetails] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'zone_details': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'zone_details': {'key': 'zoneDetails', 'type': '[ApiManagementSkuZoneDetails]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ApiManagementSkuRestrictionInfo(msrest.serialization.Model): + """ApiManagementSkuRestrictionInfo. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar locations: Locations where the SKU is restricted. + :vartype locations: list[str] + :ivar zones: List of availability zones where the SKU is restricted. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ApiManagementSkuRestrictions(msrest.serialization.Model): + """Describes scaling information of a SKU. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar type: The type of restrictions. Possible values include: "Location", "Zone". + :vartype type: str or ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionsType + :ivar values: The value of restrictions. If the restriction type is set to location. This would + be different locations where the SKU is restricted. + :vartype values: list[str] + :ivar restriction_info: The information about the restriction where the SKU cannot be used. + :vartype restriction_info: ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionInfo + :ivar reason_code: The reason for restriction. Possible values include: "QuotaId", + "NotAvailableForSubscription". + :vartype reason_code: str or + ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionsReasonCode + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'restriction_info': {'readonly': True}, + 'reason_code': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ApiManagementSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiManagementSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ApiManagementSkusResult(msrest.serialization.Model): + """The List Resource Skus operation response. + + 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. + + :param value: Required. The list of skus available for the subscription. + :type value: list[~azure.mgmt.apimanagement.models.ApiManagementSku] + :ivar next_link: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI + to fetch the next page of Resource Skus. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ApiManagementSku]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["ApiManagementSku"], + **kwargs + ): + super(ApiManagementSkusResult, self).__init__(**kwargs) + self.value = value + self.next_link = None + + +class ApiManagementSkuZoneDetails(msrest.serialization.Model): + """Describes The zonal capabilities of a SKU. Variables are only populated by the server, and will be ignored when sending a request. - :param notification_sender_email: Email address from which the notification will be sent. - :type notification_sender_email: str - :ivar provisioning_state: The current provisioning state of the API Management service which - can be one of the following: - Created/Activating/Succeeded/Updating/Failed/Stopped/Terminating/TerminationFailed/Deleted. - :vartype provisioning_state: str - :ivar target_provisioning_state: The provisioning state of the API Management service, which is - targeted by the long running operation started on the service. - :vartype target_provisioning_state: str - :ivar created_at_utc: Creation UTC date of the API Management service.The date conforms to the - following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. - :vartype created_at_utc: ~datetime.datetime - :ivar gateway_url: Gateway URL of the API Management service. - :vartype gateway_url: str - :ivar gateway_regional_url: Gateway URL of the API Management service in the Default Region. - :vartype gateway_regional_url: str - :ivar portal_url: Publisher portal endpoint Url of the API Management service. - :vartype portal_url: str - :ivar management_api_url: Management API endpoint URL of the API Management service. - :vartype management_api_url: str - :ivar scm_url: SCM endpoint URL of the API Management service. - :vartype scm_url: str - :ivar developer_portal_url: DEveloper Portal endpoint URL of the API Management service. - :vartype developer_portal_url: str - :param hostname_configurations: Custom hostname configuration of the API Management service. - :type hostname_configurations: list[~azure.mgmt.apimanagement.models.HostnameConfiguration] - :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management - service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. - :vartype public_ip_addresses: list[str] - :ivar private_ip_addresses: Private Static Load Balanced IP addresses of the API Management - service in Primary region which is deployed in an Internal Virtual Network. Available only for - Basic, Standard, Premium and Isolated SKU. - :vartype private_ip_addresses: list[str] - :param virtual_network_configuration: Virtual network configuration of the API Management - service. - :type virtual_network_configuration: - ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration - :param additional_locations: Additional datacenter locations of the API Management service. - :type additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] - :param custom_properties: Custom properties of the API Management service.
Setting - ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the - cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting - ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11`` can be used to - disable just TLS 1.1.
Setting - ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10`` can be used to - disable TLS 1.0 on an API Management service.
Setting - ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11`` can be used - to disable just TLS 1.1 for communications with backends.
Setting - ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10`` can be used - to disable TLS 1.0 for communications with backends.
Setting - ``Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2`` can be used to enable - HTTP2 protocol on an API Management service.
Not specifying any of these properties on - PATCH operation will reset omitted properties' values to their defaults. For all the settings - except Http2 the default value is ``True`` if the service was created on or before April 1st - 2018 and ``False`` otherwise. Http2 setting's default value is ``False``.

You can - disable any of next ciphers by using settings - `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: - TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, - TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, - TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, - TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. - For example, - `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:\ - ``false``. The default value is ``true`` for them. Note: next ciphers can't be disabled since - they are required by Azure CloudService internal components: - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384. - :type custom_properties: dict[str, str] - :param certificates: List of Certificates that need to be installed in the API Management - service. Max supported certificates that can be installed is 10. - :type certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] - :param enable_client_certificate: Property only meant to be used for Consumption SKU Service. - This enforces a client certificate to be presented on each request to the gateway. This also - enables the ability to authenticate the certificate in the policy on the gateway. - :type enable_client_certificate: bool - :param disable_gateway: Property only valid for an Api Management service deployed in multiple - locations. This can be used to disable the gateway in master region. - :type disable_gateway: bool - :param virtual_network_type: The type of VPN in which API Management service needs to be - configured in. None (Default Value) means the API Management service is not part of any Virtual - Network, External means the API Management deployment is set up inside a Virtual Network having - an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside - a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", - "External", "Internal". Default value: "None". - :type virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType - :param api_version_constraint: Control Plane Apis version constraint for the API Management - service. - :type api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint - :param restore: Undelete Api Management Service if it was previously soft-deleted. If this flag - is specified and set to True all other properties will be ignored. - :type restore: bool - :param publisher_email: Publisher email. - :type publisher_email: str - :param publisher_name: Publisher name. - :type publisher_name: str + :ivar name: The set of zones that the SKU is available in with the specified capabilities. + :vartype name: list[str] + :ivar capabilities: A list of capabilities that are available for the SKU in the specified list + of zones. + :vartype capabilities: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCapabilities] """ _validation = { - 'notification_sender_email': {'max_length': 100, 'min_length': 0}, - 'provisioning_state': {'readonly': True}, - 'target_provisioning_state': {'readonly': True}, - 'created_at_utc': {'readonly': True}, - 'gateway_url': {'readonly': True}, - 'gateway_regional_url': {'readonly': True}, - 'portal_url': {'readonly': True}, - 'management_api_url': {'readonly': True}, - 'scm_url': {'readonly': True}, - 'developer_portal_url': {'readonly': True}, - 'public_ip_addresses': {'readonly': True}, - 'private_ip_addresses': {'readonly': True}, - 'publisher_email': {'max_length': 100, 'min_length': 0}, - 'publisher_name': {'max_length': 100, 'min_length': 0}, + 'name': {'readonly': True}, + 'capabilities': {'readonly': True}, } _attribute_map = { - 'notification_sender_email': {'key': 'notificationSenderEmail', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'target_provisioning_state': {'key': 'targetProvisioningState', 'type': 'str'}, - 'created_at_utc': {'key': 'createdAtUtc', 'type': 'iso-8601'}, - 'gateway_url': {'key': 'gatewayUrl', 'type': 'str'}, - 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, - 'portal_url': {'key': 'portalUrl', 'type': 'str'}, - 'management_api_url': {'key': 'managementApiUrl', 'type': 'str'}, - 'scm_url': {'key': 'scmUrl', 'type': 'str'}, - 'developer_portal_url': {'key': 'developerPortalUrl', 'type': 'str'}, - 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, - 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, - 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, - 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, - 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, - 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, - 'certificates': {'key': 'certificates', 'type': '[CertificateConfiguration]'}, - 'enable_client_certificate': {'key': 'enableClientCertificate', 'type': 'bool'}, - 'disable_gateway': {'key': 'disableGateway', 'type': 'bool'}, - 'virtual_network_type': {'key': 'virtualNetworkType', 'type': 'str'}, - 'api_version_constraint': {'key': 'apiVersionConstraint', 'type': 'ApiVersionConstraint'}, - 'restore': {'key': 'restore', 'type': 'bool'}, - 'publisher_email': {'key': 'publisherEmail', 'type': 'str'}, - 'publisher_name': {'key': 'publisherName', 'type': 'str'}, + 'name': {'key': 'name', 'type': '[str]'}, + 'capabilities': {'key': 'capabilities', 'type': '[ApiManagementSkuCapabilities]'}, } def __init__( self, - *, - notification_sender_email: Optional[str] = None, - hostname_configurations: Optional[List["HostnameConfiguration"]] = None, - virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, - additional_locations: Optional[List["AdditionalLocation"]] = None, - custom_properties: Optional[Dict[str, str]] = None, - certificates: Optional[List["CertificateConfiguration"]] = None, - enable_client_certificate: Optional[bool] = False, - disable_gateway: Optional[bool] = False, - virtual_network_type: Optional[Union[str, "VirtualNetworkType"]] = "None", - api_version_constraint: Optional["ApiVersionConstraint"] = None, - restore: Optional[bool] = False, - publisher_email: Optional[str] = None, - publisher_name: Optional[str] = None, **kwargs ): - super(ApiManagementServiceUpdateProperties, self).__init__(notification_sender_email=notification_sender_email, hostname_configurations=hostname_configurations, virtual_network_configuration=virtual_network_configuration, additional_locations=additional_locations, custom_properties=custom_properties, certificates=certificates, enable_client_certificate=enable_client_certificate, disable_gateway=disable_gateway, virtual_network_type=virtual_network_type, api_version_constraint=api_version_constraint, restore=restore, **kwargs) - self.publisher_email = publisher_email - self.publisher_name = publisher_name + super(ApiManagementSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None class ApiReleaseCollection(msrest.serialization.Model): @@ -2316,6 +2843,8 @@ class ApiReleaseCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.ApiReleaseContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -2327,15 +2856,19 @@ class ApiReleaseCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[ApiReleaseContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(ApiReleaseCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -2400,6 +2933,8 @@ class ApiRevisionCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.ApiRevisionContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -2411,15 +2946,19 @@ class ApiRevisionCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[ApiRevisionContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(ApiRevisionCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -2772,12 +3311,15 @@ class ApiVersionSetCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.ApiVersionSetContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[ApiVersionSetContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -2785,11 +3327,13 @@ def __init__( self, *, value: Optional[List["ApiVersionSetContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(ApiVersionSetCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -2814,7 +3358,7 @@ class ApiVersionSetContract(Resource): :type version_header_name: str :param display_name: Name of API Version Set. :type display_name: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -2867,7 +3411,7 @@ class ApiVersionSetContractDetails(msrest.serialization.Model): :type name: str :param description: Description of API Version Set. :type description: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetailsVersioningScheme @@ -2961,7 +3505,7 @@ class ApiVersionSetContractProperties(ApiVersionSetEntityBase): :type version_header_name: str :param display_name: Required. Name of API Version Set. :type display_name: str - :param versioning_scheme: Required. An value that determines where the API Version identifer + :param versioning_scheme: Required. An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -3009,7 +3553,7 @@ class ApiVersionSetUpdateParameters(msrest.serialization.Model): :type version_header_name: str :param display_name: Name of API Version Set. :type display_name: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -3059,7 +3603,7 @@ class ApiVersionSetUpdateParametersProperties(ApiVersionSetEntityBase): :type version_header_name: str :param display_name: Name of API Version Set. :type display_name: str - :param versioning_scheme: An value that determines where the API Version identifer will be + :param versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ @@ -3896,12 +4440,15 @@ class BackendCollection(msrest.serialization.Model): :param value: Backend values. :type value: list[~azure.mgmt.apimanagement.models.BackendContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[BackendContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -3909,11 +4456,13 @@ def __init__( self, *, value: Optional[List["BackendContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(BackendCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -4069,7 +4618,10 @@ def __init__( class BackendCredentialsContract(msrest.serialization.Model): """Details of the Credentials used to connect to Backend. - :param certificate: List of Client Certificate Thumbprint. + :param certificate_ids: List of Client Certificate Ids. + :type certificate_ids: list[str] + :param certificate: List of Client Certificate Thumbprints. Will be ignored if certificatesIds + are provided. :type certificate: list[str] :param query: Query Parameter description. :type query: dict[str, list[str]] @@ -4080,10 +4632,12 @@ class BackendCredentialsContract(msrest.serialization.Model): """ _validation = { + 'certificate_ids': {'max_items': 32, 'min_items': 0}, 'certificate': {'max_items': 32, 'min_items': 0}, } _attribute_map = { + 'certificate_ids': {'key': 'certificateIds', 'type': '[str]'}, 'certificate': {'key': 'certificate', 'type': '[str]'}, 'query': {'key': 'query', 'type': '{[str]}'}, 'header': {'key': 'header', 'type': '{[str]}'}, @@ -4093,6 +4647,7 @@ class BackendCredentialsContract(msrest.serialization.Model): def __init__( self, *, + certificate_ids: Optional[List[str]] = None, certificate: Optional[List[str]] = None, query: Optional[Dict[str, List[str]]] = None, header: Optional[Dict[str, List[str]]] = None, @@ -4100,6 +4655,7 @@ def __init__( **kwargs ): super(BackendCredentialsContract, self).__init__(**kwargs) + self.certificate_ids = certificate_ids self.certificate = certificate self.query = query self.header = header @@ -4210,8 +4766,10 @@ class BackendServiceFabricClusterProperties(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. - :param client_certificatethumbprint: Required. The client certificate thumbprint for the - management endpoint. + :param client_certificate_id: The client certificate id for the management endpoint. + :type client_certificate_id: str + :param client_certificatethumbprint: The client certificate thumbprint for the management + endpoint. Will be ignored if certificatesIds are provided. :type client_certificatethumbprint: str :param max_partition_resolution_retries: Maximum number of retries while attempting resolve the partition. @@ -4226,11 +4784,11 @@ class BackendServiceFabricClusterProperties(msrest.serialization.Model): """ _validation = { - 'client_certificatethumbprint': {'required': True}, 'management_endpoints': {'required': True}, } _attribute_map = { + 'client_certificate_id': {'key': 'clientCertificateId', 'type': 'str'}, 'client_certificatethumbprint': {'key': 'clientCertificatethumbprint', 'type': 'str'}, 'max_partition_resolution_retries': {'key': 'maxPartitionResolutionRetries', 'type': 'int'}, 'management_endpoints': {'key': 'managementEndpoints', 'type': '[str]'}, @@ -4241,14 +4799,16 @@ class BackendServiceFabricClusterProperties(msrest.serialization.Model): def __init__( self, *, - client_certificatethumbprint: str, management_endpoints: List[str], + client_certificate_id: Optional[str] = None, + client_certificatethumbprint: Optional[str] = None, max_partition_resolution_retries: Optional[int] = None, server_certificate_thumbprints: Optional[List[str]] = None, server_x509_names: Optional[List["X509CertificateName"]] = None, **kwargs ): super(BackendServiceFabricClusterProperties, self).__init__(**kwargs) + self.client_certificate_id = client_certificate_id self.client_certificatethumbprint = client_certificatethumbprint self.max_partition_resolution_retries = max_partition_resolution_retries self.management_endpoints = management_endpoints @@ -4445,12 +5005,15 @@ class CacheCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.CacheContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[CacheContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -4458,11 +5021,13 @@ def __init__( self, *, value: Optional[List["CacheContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(CacheCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -4573,12 +5138,15 @@ class CertificateCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.CertificateContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[CertificateContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -4586,11 +5154,13 @@ def __init__( self, *, value: Optional[List["CertificateContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(CertificateCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -5181,12 +5751,15 @@ class DiagnosticCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.DiagnosticContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[DiagnosticContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -5194,11 +5767,13 @@ def __init__( self, *, value: Optional[List["DiagnosticContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(DiagnosticCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -5290,12 +5865,15 @@ class EmailTemplateCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.EmailTemplateContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[EmailTemplateContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -5303,11 +5881,13 @@ def __init__( self, *, value: Optional[List["EmailTemplateContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(EmailTemplateCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -5551,10 +6131,78 @@ def __init__( details: Optional[List["ErrorFieldContract"]] = None, **kwargs ): - super(ErrorResponseBody, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +class GatewayCertificateAuthorityCollection(msrest.serialization.Model): + """Paged Gateway certificate authority list representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Page values. + :vartype value: list[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract] + :ivar next_link: Next page link if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[GatewayCertificateAuthorityContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(GatewayCertificateAuthorityCollection, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class GatewayCertificateAuthorityContract(Resource): + """Gateway certificate authority details. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param is_trusted: Determines whether certificate authority is trusted. + :type is_trusted: bool + """ + + _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'}, + 'is_trusted': {'key': 'properties.isTrusted', 'type': 'bool'}, + } + + def __init__( + self, + *, + is_trusted: Optional[bool] = None, + **kwargs + ): + super(GatewayCertificateAuthorityContract, self).__init__(**kwargs) + self.is_trusted = is_trusted class GatewayCollection(msrest.serialization.Model): @@ -5564,6 +6212,8 @@ class GatewayCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.GatewayContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -5575,15 +6225,19 @@ class GatewayCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[GatewayContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(GatewayCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -5862,12 +6516,15 @@ class GroupCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.GroupContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[GroupContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -5875,11 +6532,13 @@ def __init__( self, *, value: Optional[List["GroupContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(GroupCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -6613,12 +7272,15 @@ class IdentityProviderList(msrest.serialization.Model): :param value: Identity Provider configuration values. :type value: list[~azure.mgmt.apimanagement.models.IdentityProviderContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[IdentityProviderContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -6626,11 +7288,13 @@ def __init__( self, *, value: Optional[List["IdentityProviderContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(IdentityProviderList, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -6797,6 +7461,8 @@ class IssueAttachmentCollection(msrest.serialization.Model): :ivar value: Issue Attachment values. :vartype value: list[~azure.mgmt.apimanagement.models.IssueAttachmentContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -6808,15 +7474,19 @@ class IssueAttachmentCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[IssueAttachmentContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(IssueAttachmentCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -6876,6 +7546,8 @@ class IssueCollection(msrest.serialization.Model): :ivar value: Issue values. :vartype value: list[~azure.mgmt.apimanagement.models.IssueContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -6887,15 +7559,19 @@ class IssueCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[IssueContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(IssueCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -6906,6 +7582,8 @@ class IssueCommentCollection(msrest.serialization.Model): :ivar value: Issue Comment values. :vartype value: list[~azure.mgmt.apimanagement.models.IssueCommentContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -6917,15 +7595,19 @@ class IssueCommentCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[IssueCommentContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(IssueCommentCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -7447,12 +8129,15 @@ class NamedValueCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.NamedValueContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[NamedValueContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -7460,11 +8145,13 @@ def __init__( self, *, value: Optional[List["NamedValueContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(NamedValueCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -7926,12 +8613,15 @@ class NotificationCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.NotificationContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[NotificationContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -7939,11 +8629,13 @@ def __init__( self, *, value: Optional[List["NotificationContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(NotificationCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -8054,12 +8746,15 @@ class OpenIdConnectProviderCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.OpenidConnectProviderContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[OpenidConnectProviderContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -8067,11 +8762,13 @@ def __init__( self, *, value: Optional[List["OpenidConnectProviderContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(OpenIdConnectProviderCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -8222,6 +8919,8 @@ class OperationCollection(msrest.serialization.Model): :ivar value: Page values. :vartype value: list[~azure.mgmt.apimanagement.models.OperationContract] + :param count: Total record count number across all pages. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -8233,15 +8932,19 @@ class OperationCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[OperationContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(OperationCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -8854,12 +9557,15 @@ class PolicyCollection(msrest.serialization.Model): :param value: Policy Contract value. :type value: list[~azure.mgmt.apimanagement.models.PolicyContract] + :param count: Total record count number. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[PolicyContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -8867,11 +9573,13 @@ def __init__( self, *, value: Optional[List["PolicyContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(PolicyCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -8959,7 +9667,7 @@ class PolicyDescriptionContract(Resource): :ivar description: Policy description. :vartype description: str :ivar scope: Binary OR value of the Snippet scope. - :vartype scope: int + :vartype scope: long """ _validation = { @@ -8975,7 +9683,7 @@ class PolicyDescriptionContract(Resource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'int'}, + 'scope': {'key': 'properties.scope', 'type': 'long'}, } def __init__( @@ -9137,6 +9845,97 @@ def __init__( self.updated_date_time = None +class PortalSettingsCollection(msrest.serialization.Model): + """Descriptions of APIM policies. + + :param value: Descriptions of APIM policies. + :type value: list[~azure.mgmt.apimanagement.models.PortalSettingsContract] + :param count: Total record count number. + :type count: long + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[PortalSettingsContract]'}, + 'count': {'key': 'count', 'type': 'long'}, + } + + def __init__( + self, + *, + value: Optional[List["PortalSettingsContract"]] = None, + count: Optional[int] = None, + **kwargs + ): + super(PortalSettingsCollection, self).__init__(**kwargs) + self.value = value + self.count = count + + +class PortalSettingsContract(Resource): + """Portal Settings for the Developer Portal. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param url: A delegation Url. + :type url: str + :param validation_key: A base64-encoded validation key to validate, that a request is coming + from Azure API Management. + :type validation_key: str + :param subscriptions: Subscriptions delegation settings. + :type subscriptions: ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties + :param user_registration: User registration delegation settings. + :type user_registration: + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties + :param enabled: Redirect Anonymous users to the Sign-In page. + :type enabled: bool + :param terms_of_service: Terms of service contract properties. + :type terms_of_service: ~azure.mgmt.apimanagement.models.TermsOfServiceProperties + """ + + _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'}, + 'url': {'key': 'properties.url', 'type': 'str'}, + 'validation_key': {'key': 'properties.validationKey', 'type': 'str'}, + 'subscriptions': {'key': 'properties.subscriptions', 'type': 'SubscriptionsDelegationSettingsProperties'}, + 'user_registration': {'key': 'properties.userRegistration', 'type': 'RegistrationDelegationSettingsProperties'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'terms_of_service': {'key': 'properties.termsOfService', 'type': 'TermsOfServiceProperties'}, + } + + def __init__( + self, + *, + url: Optional[str] = None, + validation_key: Optional[str] = None, + subscriptions: Optional["SubscriptionsDelegationSettingsProperties"] = None, + user_registration: Optional["RegistrationDelegationSettingsProperties"] = None, + enabled: Optional[bool] = None, + terms_of_service: Optional["TermsOfServiceProperties"] = None, + **kwargs + ): + super(PortalSettingsContract, self).__init__(**kwargs) + self.url = url + self.validation_key = validation_key + self.subscriptions = subscriptions + self.user_registration = user_registration + self.enabled = enabled + self.terms_of_service = terms_of_service + + class PortalSettingValidationKeyContract(msrest.serialization.Model): """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. @@ -9244,12 +10043,15 @@ class ProductCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.ProductContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[ProductContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -9257,11 +10059,13 @@ def __init__( self, *, value: Optional[List["ProductContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(ProductCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -9310,7 +10114,7 @@ class ProductContract(Resource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -9381,7 +10185,7 @@ class ProductEntityBaseParameters(msrest.serialization.Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, } _attribute_map = { @@ -9449,7 +10253,7 @@ class ProductContractProperties(ProductEntityBaseParameters): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'required': True, 'max_length': 300, 'min_length': 1}, } @@ -9517,7 +10321,7 @@ class ProductTagResourceContractProperties(ProductEntityBaseParameters): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'name': {'required': True, 'max_length': 300, 'min_length': 1}, } @@ -9584,7 +10388,7 @@ class ProductUpdateParameters(msrest.serialization.Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -9654,7 +10458,7 @@ class ProductUpdateProperties(ProductEntityBaseParameters): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -9851,12 +10655,15 @@ class RecipientEmailCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.RecipientEmailContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[RecipientEmailContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -9864,11 +10671,13 @@ def __init__( self, *, value: Optional[List["RecipientEmailContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(RecipientEmailCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -9941,12 +10750,15 @@ class RecipientUserCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.RecipientUserContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[RecipientUserContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -9954,11 +10766,13 @@ def __init__( self, *, value: Optional[List["RecipientUserContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(RecipientUserCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -10791,6 +11605,8 @@ class SchemaCollection(msrest.serialization.Model): :ivar value: Api Schema Contract value. :vartype value: list[~azure.mgmt.apimanagement.models.SchemaContract] + :param count: Total record count number. + :type count: long :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -10802,15 +11618,19 @@ class SchemaCollection(msrest.serialization.Model): _attribute_map = { 'value': {'key': 'value', 'type': '[SchemaContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } def __init__( self, + *, + count: Optional[int] = None, **kwargs ): super(SchemaCollection, self).__init__(**kwargs) self.value = None + self.count = count self.next_link = None @@ -10873,12 +11693,15 @@ class SubscriptionCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.SubscriptionContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[SubscriptionContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -10886,11 +11709,13 @@ def __init__( self, *, value: Optional[List["SubscriptionContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(SubscriptionCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -11245,12 +12070,15 @@ class TagCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.TagContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[TagContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -11258,11 +12086,13 @@ def __init__( self, *, value: Optional[List["TagContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(TagCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -11370,12 +12200,15 @@ class TagDescriptionCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.TagDescriptionContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[TagDescriptionContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -11383,11 +12216,13 @@ def __init__( self, *, value: Optional[List["TagDescriptionContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(TagDescriptionCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -11534,12 +12369,15 @@ class TagResourceCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.TagResourceContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[TagResourceContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -11547,11 +12385,13 @@ def __init__( self, *, value: Optional[List["TagResourceContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(TagResourceCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -11682,6 +12522,74 @@ def __init__( self.configuration_change_date = configuration_change_date +class TenantSettingsCollection(msrest.serialization.Model): + """Paged AccessInformation list representation. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Page values. + :vartype value: list[~azure.mgmt.apimanagement.models.TenantSettingsContract] + :ivar next_link: Next page link if any. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[TenantSettingsContract]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(TenantSettingsCollection, self).__init__(**kwargs) + self.value = None + self.next_link = None + + +class TenantSettingsContract(Resource): + """Tenant Settings. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type for API Management resource. + :vartype type: str + :param settings: Tenant settings. + :type settings: dict[str, str] + """ + + _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'}, + 'settings': {'key': 'properties.settings', 'type': '{str}'}, + } + + def __init__( + self, + *, + settings: Optional[Dict[str, str]] = None, + **kwargs + ): + super(TenantSettingsContract, self).__init__(**kwargs) + self.settings = settings + + class TermsOfServiceProperties(msrest.serialization.Model): """Terms of service contract properties. @@ -11751,12 +12659,15 @@ class UserCollection(msrest.serialization.Model): :param value: Page values. :type value: list[~azure.mgmt.apimanagement.models.UserContract] + :param count: Total record count number across all pages. + :type count: long :param next_link: Next page link if any. :type next_link: str """ _attribute_map = { 'value': {'key': 'value', 'type': '[UserContract]'}, + 'count': {'key': 'count', 'type': 'long'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } @@ -11764,11 +12675,13 @@ def __init__( self, *, value: Optional[List["UserContract"]] = None, + count: Optional[int] = None, next_link: Optional[str] = None, **kwargs ): super(UserCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py index 9a9b4ae48f31..cd77fa38b0ba 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/__init__.py @@ -38,6 +38,7 @@ from ._gateway_operations import GatewayOperations from ._gateway_hostname_configuration_operations import GatewayHostnameConfigurationOperations from ._gateway_api_operations import GatewayApiOperations +from ._gateway_certificate_authority_operations import GatewayCertificateAuthorityOperations from ._group_operations import GroupOperations from ._group_user_operations import GroupUserOperations from ._identity_provider_operations import IdentityProviderOperations @@ -52,6 +53,7 @@ from ._policy_operations import PolicyOperations from ._policy_description_operations import PolicyDescriptionOperations from ._portal_revision_operations import PortalRevisionOperations +from ._portal_settings_operations import PortalSettingsOperations from ._sign_in_settings_operations import SignInSettingsOperations from ._sign_up_settings_operations import SignUpSettingsOperations from ._delegation_settings_operations import DelegationSettingsOperations @@ -64,6 +66,8 @@ from ._quota_by_period_keys_operations import QuotaByPeriodKeysOperations from ._region_operations import RegionOperations from ._reports_operations import ReportsOperations +from ._tenant_settings_operations import TenantSettingsOperations +from ._api_management_skus_operations import ApiManagementSkusOperations from ._subscription_operations import SubscriptionOperations from ._tag_resource_operations import TagResourceOperations from ._tenant_access_operations import TenantAccessOperations @@ -108,6 +112,7 @@ 'GatewayOperations', 'GatewayHostnameConfigurationOperations', 'GatewayApiOperations', + 'GatewayCertificateAuthorityOperations', 'GroupOperations', 'GroupUserOperations', 'IdentityProviderOperations', @@ -122,6 +127,7 @@ 'PolicyOperations', 'PolicyDescriptionOperations', 'PortalRevisionOperations', + 'PortalSettingsOperations', 'SignInSettingsOperations', 'SignUpSettingsOperations', 'DelegationSettingsOperations', @@ -134,6 +140,8 @@ 'QuotaByPeriodKeysOperations', 'RegionOperations', 'ReportsOperations', + 'TenantSettingsOperations', + 'ApiManagementSkusOperations', 'SubscriptionOperations', 'TagResourceOperations', 'TenantAccessOperations', diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_diagnostic_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_diagnostic_operations.py index 1836c12cb78b..6a52d4069cb6 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_diagnostic_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_diagnostic_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -172,7 +172,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -242,7 +242,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -320,7 +320,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -410,7 +410,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -491,7 +491,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_export_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_export_operations.py index 67206347069d..b577831e02f5 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_export_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_export_operations.py @@ -79,7 +79,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_attachment_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_attachment_operations.py index 05d498d331e1..457d7aee7c94 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_attachment_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_attachment_operations.py @@ -87,7 +87,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -183,7 +183,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -258,7 +258,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -341,7 +341,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -433,7 +433,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_comment_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_comment_operations.py index 038e08555913..361d4f5f8fdd 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_comment_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_comment_operations.py @@ -87,7 +87,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -182,7 +182,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -256,7 +256,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -338,7 +338,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -429,7 +429,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_operations.py index 54cadc8395fe..f85a22fa59b6 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_issue_operations.py @@ -87,7 +87,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -179,7 +179,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -252,7 +252,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -332,7 +332,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -422,7 +422,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -503,7 +503,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py index 7295e02a1aa6..03703a4bbb9c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -98,8 +98,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_operations.py index 38d8761fa985..587ddda50884 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_operations.py @@ -60,7 +60,7 @@ def _restore_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -192,7 +192,7 @@ def _backup_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -322,7 +322,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -455,7 +455,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -594,7 +594,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -643,7 +643,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -770,7 +770,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -839,7 +839,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -879,8 +879,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -912,7 +913,7 @@ def get_sso_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -969,7 +970,7 @@ def check_name_availability( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1009,6 +1010,58 @@ def check_name_availability( return deserialized check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability'} # type: ignore + def get_domain_ownership_identifier( + self, + **kwargs # type: Any + ): + # type: (...) -> "_models.ApiManagementServiceGetDomainOwnershipIdentifierResult" + """Get the custom domain ownership identifier for an API Management service. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ApiManagementServiceGetDomainOwnershipIdentifierResult, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceGetDomainOwnershipIdentifierResult + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceGetDomainOwnershipIdentifierResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('ApiManagementServiceGetDomainOwnershipIdentifierResult', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier'} # type: ignore + def _apply_network_configuration_updates_initial( self, resource_group_name, # type: str @@ -1022,7 +1075,7 @@ def _apply_network_configuration_updates_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1078,7 +1131,7 @@ def begin_apply_network_configuration_updates( ): # type: (...) -> LROPoller["_models.ApiManagementServiceResource"] """Updates the Microsoft.ApiManagement resource running in the Virtual network to pick the updated - network settings. + DNS changes. :param resource_group_name: The name of the resource group. :type resource_group_name: str diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_skus_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_skus_operations.py index c7d8158da7d2..b84ceec3d65c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_skus_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_service_skus_operations.py @@ -70,7 +70,7 @@ def list_available_service_skus( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py new file mode 100644 index 000000000000..606b228d6f03 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py @@ -0,0 +1,114 @@ +# 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.paging import ItemPaged +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, Iterable, Optional, TypeVar + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class ApiManagementSkusOperations(object): + """ApiManagementSkusOperations 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.apimanagement.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 list( + self, + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ApiManagementSkusResult"] + """Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. + + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ApiManagementSkusResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiManagementSkusResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementSkusResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ApiManagementSkusResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_operations.py index 6aaaa9817528..053fc6702ad9 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_operations.py @@ -91,7 +91,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -184,7 +184,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -255,7 +255,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -334,7 +334,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -425,7 +425,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -507,7 +507,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_policy_operations.py index 2895e9728200..07af63ce6f90 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_policy_operations.py @@ -75,7 +75,7 @@ def list_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -148,7 +148,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -226,7 +226,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -311,7 +311,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -403,7 +403,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py index f9e39b2b978a..2bc59fbd4090 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operations.py @@ -92,7 +92,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -182,7 +182,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -248,7 +248,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json, application/vnd.swagger.doc+json, application/vnd.oai.openapi+json, application/vnd.sun.wadl+xml, application/wsdl+xml" # Construct URL @@ -308,7 +308,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -481,7 +481,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -561,7 +561,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -642,7 +642,7 @@ def list_by_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_policy_operations.py index a66b94e7d56e..3b3a4f7a8c79 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_policy_operations.py @@ -71,7 +71,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -139,7 +139,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -212,7 +212,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json, application/vnd.ms-azure-apim.policy+xml, application/vnd.ms-azure-apim.policy.raw+xml" # Construct URL @@ -297,7 +297,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -384,7 +384,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_product_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_product_operations.py index 3fb92d3c3557..3b2d4e055715 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_product_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_product_operations.py @@ -82,7 +82,7 @@ def list_by_apis( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_release_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_release_operations.py index ba0ed15f7d8d..974714437193 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_release_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_release_operations.py @@ -84,7 +84,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -174,7 +174,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -244,7 +244,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -322,7 +322,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -412,7 +412,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -493,7 +493,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_revision_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_revision_operations.py index 5603a9a95556..ff3b094c1a1b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_revision_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_revision_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py index 1ab3c56724e9..08b141624128 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_schema_operations.py @@ -85,7 +85,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -176,7 +176,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -247,7 +247,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -304,7 +304,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -488,7 +488,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_tag_description_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_tag_description_operations.py index 4bdea038f508..769a3640ec3f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_tag_description_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_tag_description_operations.py @@ -85,7 +85,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -176,7 +176,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -247,7 +247,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -326,7 +326,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -414,7 +414,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_version_set_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_version_set_operations.py index eb65a0bd6993..e769a27c813f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_version_set_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_version_set_operations.py @@ -78,7 +78,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -164,7 +164,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -230,7 +230,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -304,7 +304,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -390,7 +390,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -467,7 +467,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py index 9f8243227e09..504a75ac25a2 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_authorization_server_operations.py @@ -81,7 +81,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -166,7 +166,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -231,7 +231,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -304,7 +304,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -389,7 +389,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -465,7 +465,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -527,7 +527,7 @@ def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_backend_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_backend_operations.py index 7448bccfc591..1e545c86d65c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_backend_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_backend_operations.py @@ -81,7 +81,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -167,7 +167,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -233,7 +233,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -307,7 +307,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -393,7 +393,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -470,7 +470,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -537,7 +537,7 @@ def reconnect( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_cache_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_cache_operations.py index ad3d4cf81f4d..b286d1af6a8a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_cache_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_cache_operations.py @@ -74,7 +74,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -158,7 +158,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -224,7 +224,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -298,7 +298,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -384,7 +384,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -461,7 +461,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_certificate_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_certificate_operations.py index 5e7bdfabe057..a33ef140fa0a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_certificate_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_certificate_operations.py @@ -52,6 +52,7 @@ def list_by_service( filter=None, # type: Optional[str] top=None, # type: Optional[int] skip=None, # type: Optional[int] + is_key_vault_refresh_failed=None, # type: Optional[bool] **kwargs # type: Any ): # type: (...) -> Iterable["_models.CertificateCollection"] @@ -72,6 +73,9 @@ def list_by_service( :type top: int :param skip: Number of records to skip. :type skip: int + :param is_key_vault_refresh_failed: When set to true, the response contains only certificates + entities which failed refresh. + :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateCollection or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.CertificateCollection] @@ -82,7 +86,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -107,6 +111,8 @@ def prepare_request(next_link=None): query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if is_key_vault_refresh_failed is not None: + query_parameters['isKeyVaultRefreshFailed'] = self._serialize.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -168,7 +174,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -234,7 +240,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -308,7 +314,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -391,7 +397,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -426,3 +432,70 @@ def delete( return cls(pipeline_response, None, {}) delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + + def refresh_secret( + self, + resource_group_name, # type: str + service_name, # type: str + certificate_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CertificateContract" + """From KeyVault, Refresh the certificate being used for authentication with the backend. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CertificateContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.refresh_secret.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('CertificateContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py index 4a610f7d5355..cbd657ceedac 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py @@ -71,7 +71,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -154,7 +154,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -223,7 +223,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -297,7 +297,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -378,7 +378,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py index aa6c61a99cb8..b152732d21d3 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py @@ -68,7 +68,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -147,7 +147,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -217,7 +217,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -294,7 +294,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_delegation_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_delegation_settings_operations.py index 538cc3fb3107..666ffab87543 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_delegation_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_delegation_settings_operations.py @@ -67,7 +67,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -128,7 +128,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -197,7 +197,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -267,7 +267,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -334,7 +334,7 @@ def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py index e4dff97f5a13..894d328a9977 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py @@ -12,13 +12,15 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -62,7 +64,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -136,7 +138,7 @@ def get_by_name( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -173,34 +175,23 @@ def get_by_name( return deserialized get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore - def purge( + def _purge_initial( self, service_name, # type: str location, # type: str **kwargs # type: Any ): # type: (...) -> Optional["_models.DeletedServiceContract"] - """Purges Api Management Service (deletes it with no option to undelete). - - :param service_name: The name of the API Management service. - :type service_name: str - :param location: The location of the deleted API Management service. - :type location: str - :keyword callable cls: A custom type or function that will be passed the direct response - :return: DeletedServiceContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.DeletedServiceContract or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.DeletedServiceContract"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL - url = self.purge.metadata['url'] # type: ignore + url = self._purge_initial.metadata['url'] # type: ignore path_format_arguments = { 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), @@ -233,4 +224,72 @@ def purge( return cls(pipeline_response, deserialized, {}) return deserialized - purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + + def begin_purge( + self, + service_name, # type: str + location, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.DeletedServiceContract"] + """Purges Api Management Service (deletes it with no option to undelete). + + :param service_name: The name of the API Management service. + :type service_name: str + :param location: The location of the deleted API Management service. + :type location: 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 + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServiceContract"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._purge_initial( + service_name=service_name, + location=location, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('DeletedServiceContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, '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: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_diagnostic_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_diagnostic_operations.py index f7f93d2d56c2..4ff4f0c47923 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_diagnostic_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_diagnostic_operations.py @@ -79,7 +79,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -165,7 +165,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -231,7 +231,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -305,7 +305,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -391,7 +391,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -468,7 +468,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_email_template_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_email_template_operations.py index 385f9e99f4ba..883177d6c564 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_email_template_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_email_template_operations.py @@ -79,7 +79,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -164,7 +164,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -229,7 +229,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -302,7 +302,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -384,7 +384,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -460,7 +460,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_api_operations.py index 844e638b80e7..9f30d17bd7bf 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_api_operations.py @@ -83,7 +83,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -173,7 +173,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -246,7 +246,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -327,7 +327,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py new file mode 100644 index 000000000000..6f1b717a4446 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py @@ -0,0 +1,450 @@ +# 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.paging import ItemPaged +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, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GatewayCertificateAuthorityOperations(object): + """GatewayCertificateAuthorityOperations 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.apimanagement.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 list_by_service( + self, + resource_group_name, # type: str + service_name, # type: str + gateway_id, # type: str + filter=None, # type: Optional[str] + top=None, # type: Optional[int] + skip=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GatewayCertificateAuthorityCollection"] + """Lists the collection of Certificate Authorities for the specified Gateway entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param filter: | Field | Usage | Supported operators | Supported + functions |
|-------------|-------------|-------------|-------------|
| name | + filter | eq, ne | |
. + :type filter: str + :param top: Number of records to return. + :type top: int + :param skip: Number of records to skip. + :type skip: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GatewayCertificateAuthorityCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('GatewayCertificateAuthorityCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities'} # type: ignore + + def get_entity_tag( + self, + resource_group_name, # type: str + service_name, # type: str + gateway_id, # type: str + certificate_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> bool + """Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: bool, or the result of cls(response) + :rtype: bool + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-12-01" + accept = "application/json" + + # Construct URL + url = self.get_entity_tag.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.head(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + + if cls: + return cls(pipeline_response, None, response_headers) + + return 200 <= response.status_code <= 299 + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + + def get( + self, + resource_group_name, # type: str + service_name, # type: str + gateway_id, # type: str + certificate_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.GatewayCertificateAuthorityContract" + """Get assigned Gateway Certificate Authority details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GatewayCertificateAuthorityContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('GatewayCertificateAuthorityContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + + def create_or_update( + self, + resource_group_name, # type: str + service_name, # type: str + gateway_id, # type: str + certificate_id, # type: str + parameters, # type: "_models.GatewayCertificateAuthorityContract" + if_match=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.GatewayCertificateAuthorityContract" + """Assign Certificate entity to Gateway entity as Certificate Authority. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :param parameters: + :type parameters: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + :param if_match: ETag of the Entity. Not required when creating an entity, but required when + updating an entity. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GatewayCertificateAuthorityContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create_or_update.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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] + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'GatewayCertificateAuthorityContract') + body_content_kwargs['content'] = body_content + request = self._client.put(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, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('GatewayCertificateAuthorityContract', pipeline_response) + + if response.status_code == 201: + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('GatewayCertificateAuthorityContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + + def delete( + self, + resource_group_name, # type: str + service_name, # type: str + gateway_id, # type: str + certificate_id, # type: str + if_match, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Remove relationship between Certificate Authority and Gateway entity. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param gateway_id: Gateway entity identifier. Must be unique in the current API Management + service instance. Must not have value 'managed'. + :type gateway_id: str + :param certificate_id: Identifier of the certificate entity. Must be unique in the current API + Management service instance. + :type certificate_id: str + :param if_match: ETag of the Entity. ETag should match the current entity state from the header + response of the GET request or it should be * for unconditional update. + :type if_match: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + 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-12-01" + accept = "application/json" + + # Construct URL + url = self.delete.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'gatewayId': self._serialize.url("gateway_id", gateway_id, 'str', max_length=80, min_length=1), + 'certificateId': self._serialize.url("certificate_id", certificate_id, 'str', max_length=80, min_length=1, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_hostname_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_hostname_configuration_operations.py index 87bb21023f57..10a71e9c8800 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_hostname_configuration_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_hostname_configuration_operations.py @@ -84,7 +84,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -176,7 +176,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -247,7 +247,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -326,7 +326,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -414,7 +414,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_operations.py index 3d43279601a1..e3dc53c72665 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -168,7 +168,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -234,7 +234,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -308,7 +308,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -394,7 +394,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -471,7 +471,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -534,7 +534,7 @@ def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -604,7 +604,7 @@ def regenerate_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -674,7 +674,7 @@ def generate_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_operations.py index 6cb69d02fd97..65eafa95ce1d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -168,7 +168,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -234,7 +234,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -308,7 +308,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -394,7 +394,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -471,7 +471,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_user_operations.py index ce36535b482c..9c69bb915257 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_group_user_operations.py @@ -88,7 +88,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -178,7 +178,7 @@ def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -245,7 +245,7 @@ def create( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -318,7 +318,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py index 81775d4e7941..e82c28ca137c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_identity_provider_operations.py @@ -68,7 +68,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -147,7 +147,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -213,7 +213,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -286,7 +286,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -371,7 +371,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -447,7 +447,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -509,7 +509,7 @@ def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_issue_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_issue_operations.py index f7bf66be467d..9bbe646f5cb2 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_issue_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_issue_operations.py @@ -84,7 +84,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -170,7 +170,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_logger_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_logger_operations.py index 513759fabd31..7715e57d2241 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_logger_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_logger_operations.py @@ -82,7 +82,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -167,7 +167,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -232,7 +232,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -305,7 +305,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -390,7 +390,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -466,7 +466,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_named_value_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_named_value_operations.py index 1299a3a91613..01aa814e68e0 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_named_value_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_named_value_operations.py @@ -54,6 +54,7 @@ def list_by_service( filter=None, # type: Optional[str] top=None, # type: Optional[int] skip=None, # type: Optional[int] + is_key_vault_refresh_failed=None, # type: Optional[bool] **kwargs # type: Any ): # type: (...) -> Iterable["_models.NamedValueCollection"] @@ -73,6 +74,9 @@ def list_by_service( :type top: int :param skip: Number of records to skip. :type skip: int + :param is_key_vault_refresh_failed: When set to true, the response contains only named value + entities which failed refresh. + :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NamedValueCollection or the result of cls(response) :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.NamedValueCollection] @@ -83,7 +87,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -108,6 +112,8 @@ def prepare_request(next_link=None): query_parameters['$top'] = self._serialize.query("top", top, 'int', minimum=1) if skip is not None: query_parameters['$skip'] = self._serialize.query("skip", skip, 'int', minimum=0) + if is_key_vault_refresh_failed is not None: + query_parameters['isKeyVaultRefreshFailed'] = self._serialize.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') request = self._client.get(url, query_parameters, header_parameters) @@ -168,7 +174,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -233,7 +239,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -288,7 +294,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -441,7 +447,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -604,7 +610,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -666,7 +672,7 @@ def list_value( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -705,3 +711,134 @@ def list_value( return deserialized list_value.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue'} # type: ignore + + def _refresh_secret_initial( + self, + resource_group_name, # type: str + service_name, # type: str + named_value_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.NamedValueContract"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.NamedValueContract"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self._refresh_secret_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, min_length=0, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + deserialized = None + if response.status_code == 200: + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('NamedValueContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + _refresh_secret_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore + + def begin_refresh_secret( + self, + resource_group_name, # type: str + service_name, # type: str + named_value_id, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.NamedValueContract"] + """Refresh the secret of the named value specified by its identifier. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param named_value_id: Identifier of the NamedValue. + :type named_value_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: True for ARMPolling, False for no polling, or a + polling object for 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 NamedValueContract or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._refresh_secret_initial( + resource_group_name=resource_group_name, + service_name=service_name, + named_value_id=named_value_id, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('NamedValueContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'namedValueId': self._serialize.url("named_value_id", named_value_id, 'str', max_length=256, min_length=0, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_network_status_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_network_status_operations.py index 5278fb8734e1..78ed68367ad0 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_network_status_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_network_status_operations.py @@ -69,7 +69,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -135,7 +135,7 @@ def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_operations.py index 263fa5dbf913..c47873fa919e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_operations.py @@ -74,7 +74,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -157,7 +157,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -225,7 +225,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_email_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_email_operations.py index f4585f946cf5..49e0350e90cc 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_email_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_email_operations.py @@ -70,7 +70,7 @@ def list_by_notification( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -137,7 +137,7 @@ def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -275,7 +275,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_user_operations.py index 936a4b026a09..726de087588c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_notification_recipient_user_operations.py @@ -70,7 +70,7 @@ def list_by_notification( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -137,7 +137,7 @@ def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -203,7 +203,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -275,7 +275,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py index c31c5517ae3a..621fdfeb29e5 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_open_id_connect_provider_operations.py @@ -81,7 +81,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -166,7 +166,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -231,7 +231,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -304,7 +304,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -389,7 +389,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -465,7 +465,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -527,7 +527,7 @@ def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_operation_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_operation_operations.py index eeb5a9ea1948..46bd39275103 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_operation_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_operation_operations.py @@ -92,7 +92,7 @@ def list_by_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -143,8 +143,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_description_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_description_operations.py index eb49c4a461f1..22d81f0c4722 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_description_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_description_operations.py @@ -70,7 +70,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_operations.py index 66096be32ed1..956e8c832502 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_policy_operations.py @@ -67,7 +67,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -131,7 +131,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -199,7 +199,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -274,7 +274,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -356,7 +356,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py index e59fb2da1ac3..d0f94ac59a16 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py @@ -90,7 +90,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -176,7 +176,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -242,7 +242,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -296,7 +296,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -439,7 +439,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_settings_operations.py new file mode 100644 index 000000000000..7f1d919597fa --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_settings_operations.py @@ -0,0 +1,105 @@ +# 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 PortalSettingsOperations(object): + """PortalSettingsOperations 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.apimanagement.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 list_by_service( + self, + resource_group_name, # type: str + service_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.PortalSettingsCollection" + """Lists a collection of portalsettings defined within a service instance.. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: PortalSettingsCollection, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.PortalSettingsCollection + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSettingsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('PortalSettingsCollection', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_api_operations.py index 5cf13320d8f7..119972d5ca6f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_api_operations.py @@ -88,7 +88,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -179,7 +179,7 @@ def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -247,7 +247,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -321,7 +321,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_group_operations.py index ec239a896782..ec0e8eb50e57 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_group_operations.py @@ -84,7 +84,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -175,7 +175,7 @@ def check_entity_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -243,7 +243,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -317,7 +317,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_operations.py index b29160066604..6c5c60381004 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_operations.py @@ -90,7 +90,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -180,7 +180,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -246,7 +246,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -320,7 +320,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -406,7 +406,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -486,7 +486,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -565,7 +565,7 @@ def list_by_tags( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_policy_operations.py index 699761447ad7..d1f974f555b4 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_policy_operations.py @@ -71,7 +71,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -139,7 +139,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -212,7 +212,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -292,7 +292,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -379,7 +379,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_subscriptions_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_subscriptions_operations.py index fc92405a9dd1..0c41da03d14e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_subscriptions_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_subscriptions_operations.py @@ -91,7 +91,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py index e787910cb65e..d0a9934dd52e 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_counter_keys_operations.py @@ -74,7 +74,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -145,7 +145,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py index a34db7d445a5..c66a34db3ab0 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_quota_by_period_keys_operations.py @@ -77,7 +77,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -151,7 +151,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_region_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_region_operations.py index 41d7d7b990fe..ccce1953af63 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_region_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_region_operations.py @@ -68,7 +68,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_reports_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_reports_operations.py index e27fdd6abf99..b64cbf3b7235 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_reports_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_reports_operations.py @@ -81,7 +81,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -130,8 +130,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -187,7 +188,7 @@ def list_by_user( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -236,8 +237,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -293,7 +295,7 @@ def list_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -342,8 +344,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -398,7 +401,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -447,8 +450,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -501,7 +505,7 @@ def list_by_geo( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -548,8 +552,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -604,7 +609,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -653,8 +658,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -715,7 +721,7 @@ def list_by_time( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -765,8 +771,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -811,7 +818,7 @@ def list_by_request( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -858,8 +865,9 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_in_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_in_settings_operations.py index b843087f0e91..3d8eb0bb107a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_in_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_in_settings_operations.py @@ -67,7 +67,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -128,7 +128,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -197,7 +197,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -267,7 +267,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_up_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_up_settings_operations.py index 1b6b1f2cbf3e..d8526bd46301 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_up_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_sign_up_settings_operations.py @@ -67,7 +67,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -128,7 +128,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -197,7 +197,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -267,7 +267,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py index 8719710c46b6..17b20aff5525 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_subscription_operations.py @@ -87,7 +87,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -174,7 +174,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -240,7 +240,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -325,7 +325,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -426,7 +426,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -507,7 +507,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -570,7 +570,7 @@ def regenerate_primary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -632,7 +632,7 @@ def regenerate_secondary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -694,7 +694,7 @@ def list_secrets( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_operations.py index fddc08ae76f9..474134b93b71 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_operations.py @@ -88,7 +88,7 @@ def list_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -183,7 +183,7 @@ def get_entity_state_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -258,7 +258,7 @@ def get_by_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -334,7 +334,7 @@ def assign_to_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -412,7 +412,7 @@ def detach_from_operation( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -488,7 +488,7 @@ def list_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -578,7 +578,7 @@ def get_entity_state_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -648,7 +648,7 @@ def get_by_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -719,7 +719,7 @@ def assign_to_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -795,7 +795,7 @@ def detach_from_api( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -870,7 +870,7 @@ def list_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -960,7 +960,7 @@ def get_entity_state_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1030,7 +1030,7 @@ def get_by_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1101,7 +1101,7 @@ def assign_to_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1174,7 +1174,7 @@ def detach_from_product( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1249,7 +1249,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -1336,7 +1336,7 @@ def get_entity_state( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1401,7 +1401,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -1474,7 +1474,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1559,7 +1559,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1635,7 +1635,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_resource_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_resource_operations.py index 7d1d30f88dba..32247573b005 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_resource_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tag_resource_operations.py @@ -91,7 +91,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py index 2df5540bc17a..f629038740ee 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_git_operations.py @@ -44,72 +44,6 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def get( - self, - resource_group_name, # type: str - service_name, # type: str - access_name, # type: Union[str, "_models.AccessIdName"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AccessInformationContract" - """Gets the Git access configuration for the tenant. Without secrets. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param service_name: The name of the API Management service. - :type service_name: str - :param access_name: The identifier of the Access configuration. - :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessInformationContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" - accept = "application/json" - - # Construct URL - url = self.get.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'accessName': self._serialize.url("access_name", access_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['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - 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(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('AccessInformationContract', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git'} # type: ignore - def regenerate_primary_key( self, resource_group_name, # type: str @@ -136,7 +70,7 @@ def regenerate_primary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -197,7 +131,7 @@ def regenerate_secondary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -231,69 +165,3 @@ def regenerate_secondary_key( return cls(pipeline_response, None, {}) regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'} # type: ignore - - def list_secrets( - self, - resource_group_name, # type: str - service_name, # type: str - access_name, # type: Union[str, "_models.AccessIdName"] - **kwargs # type: Any - ): - # type: (...) -> "_models.AccessInformationContract" - """Gets the Git access configuration for the tenant. - - :param resource_group_name: The name of the resource group. - :type resource_group_name: str - :param service_name: The name of the API Management service. - :type service_name: str - :param access_name: The identifier of the Access configuration. - :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessInformationContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" - accept = "application/json" - - # Construct URL - url = self.list_secrets.metadata['url'] # type: ignore - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'accessName': self._serialize.url("access_name", access_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['Accept'] = self._serialize.header("accept", accept, 'str') - - request = self._client.post(url, query_parameters, header_parameters) - 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(_models.ErrorResponse, response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('AccessInformationContract', pipeline_response) - - if cls: - return cls(pipeline_response, deserialized, response_headers) - - return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/listSecrets'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py index 019713abf215..03e9e98c120b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py @@ -9,6 +9,7 @@ import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -17,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,6 +45,87 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config + def list_by_service( + self, + resource_group_name, # type: str + service_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.AccessInformationCollection"] + """Returns list of access infos - for Git and Management endpoints. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: Not used. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either AccessInformationCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.AccessInformationCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('AccessInformationCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant'} # type: ignore + def get_entity_tag( self, resource_group_name, # type: str @@ -70,7 +152,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -135,7 +217,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -175,6 +257,85 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + def create( + self, + resource_group_name, # type: str + service_name, # type: str + access_name, # type: Union[str, "_models.AccessIdName"] + if_match, # type: str + parameters, # type: "_models.AccessInformationCreateParameters" + **kwargs # type: Any + ): + # type: (...) -> "_models.AccessInformationContract" + """Update tenant access information details. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param access_name: The identifier of the Access configuration. + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName + :param if_match: ETag of the Entity. ETag should match the current entity state from the header + response of the GET request or it should be * for unconditional update. + :type if_match: str + :param parameters: Parameters supplied to retrieve the Tenant Access Information. + :type parameters: ~azure.mgmt.apimanagement.models.AccessInformationCreateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :return: AccessInformationContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self.create.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'accessName': self._serialize.url("access_name", access_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(parameters, 'AccessInformationCreateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('AccessInformationContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + def update( self, resource_group_name, # type: str @@ -208,7 +369,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -280,7 +441,7 @@ def regenerate_primary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -341,7 +502,7 @@ def regenerate_secondary_key( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -383,7 +544,7 @@ def list_secrets( access_name, # type: Union[str, "_models.AccessIdName"] **kwargs # type: Any ): - # type: (...) -> "_models.AccessInformationContract" + # type: (...) -> "_models.AccessInformationSecretsContract" """Get tenant access information details. :param resource_group_name: The name of the resource group. @@ -393,16 +554,16 @@ def list_secrets( :param access_name: The identifier of the Access configuration. :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response - :return: AccessInformationContract, or the result of cls(response) - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract + :return: AccessInformationSecretsContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationSecretsContract :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationSecretsContract"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -434,7 +595,7 @@ def list_secrets( response_headers = {} response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) - deserialized = self._deserialize('AccessInformationContract', pipeline_response) + deserialized = self._deserialize('AccessInformationSecretsContract', pipeline_response) if cls: return cls(pipeline_response, deserialized, response_headers) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_configuration_operations.py index 5f01c1d61ccd..4befc757e7bb 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_configuration_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_configuration_operations.py @@ -60,7 +60,7 @@ def _deploy_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -197,7 +197,7 @@ def _save_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -334,7 +334,7 @@ def _validate_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -484,7 +484,7 @@ def get_sync_state( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -511,7 +511,8 @@ def get_sync_state( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('TenantConfigurationSyncStateContract', pipeline_response) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_settings_operations.py new file mode 100644 index 000000000000..642c64d83ec2 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_settings_operations.py @@ -0,0 +1,193 @@ +# 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.paging import ItemPaged +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, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class TenantSettingsOperations(object): + """TenantSettingsOperations 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.apimanagement.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 list_by_service( + self, + resource_group_name, # type: str + service_name, # type: str + filter=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.TenantSettingsCollection"] + """Public settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param filter: Not used. + :type filter: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either TenantSettingsCollection or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TenantSettingsCollection] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsCollection"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('TenantSettingsCollection', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + error = self._deserialize(_models.ErrorResponse, response) + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings'} # type: ignore + + def get( + self, + resource_group_name, # type: str + service_name, # type: str + settings_type, # type: Union[str, "_models.SettingsTypeName"] + **kwargs # type: Any + ): + # type: (...) -> "_models.TenantSettingsContract" + """Get tenant settings. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param settings_type: The identifier of the settings. + :type settings_type: str or ~azure.mgmt.apimanagement.models.SettingsTypeName + :keyword callable cls: A custom type or function that will be passed the direct response + :return: TenantSettingsContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.TenantSettingsContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + 'settingsType': self._serialize.url("settings_type", settings_type, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('TenantSettingsContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}'} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py index df7aef1ffdd2..bcf610bd033b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py @@ -74,7 +74,7 @@ def send( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_group_operations.py index f0640c983c2b..3522f7ef4888 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_group_operations.py @@ -86,7 +86,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_identities_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_identities_operations.py index ee21dcb5a65c..766f92164932 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_identities_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_identities_operations.py @@ -71,7 +71,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py index fe3c480aee05..180241b92788 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_operations.py @@ -88,7 +88,7 @@ def list_by_service( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -175,7 +175,7 @@ def get_entity_tag( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -240,7 +240,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -316,7 +316,7 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -403,7 +403,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -489,7 +489,7 @@ def delete( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -558,7 +558,7 @@ def generate_sso_url( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" # Construct URL @@ -625,7 +625,7 @@ def get_shared_access_token( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_subscription_operations.py index 232b88e1ef4b..38ed5e737082 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_subscription_operations.py @@ -89,7 +89,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-06-01-preview" + api_version = "2020-12-01" accept = "application/json" def prepare_request(next_link=None): @@ -148,3 +148,74 @@ def get_next(next_link=None): get_next, extract_data ) list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions'} # type: ignore + + def get( + self, + resource_group_name, # type: str + service_name, # type: str + user_id, # type: str + sid, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.SubscriptionContract" + """Gets the specified Subscription entity associated with a particular user. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param service_name: The name of the API Management service. + :type service_name: str + :param user_id: User identifier. Must be unique in the current API Management service instance. + :type user_id: str + :param sid: Subscription entity Identifier. The entity represents the association between a + user and a product in API Management. + :type sid: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: SubscriptionContract, or the result of cls(response) + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2020-12-01" + accept = "application/json" + + # Construct URL + url = self.get.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=1, pattern=r'^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$'), + 'userId': self._serialize.url("user_id", user_id, 'str', max_length=80, min_length=1), + 'sid': self._serialize.url("sid", sid, 'str', max_length=256, min_length=0, pattern=r'^[^*#&+:<>?]+$'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, '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['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + 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(_models.ErrorResponse, response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers['ETag']=self._deserialize('str', response.headers.get('ETag')) + deserialized = self._deserialize('SubscriptionContract', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}'} # type: ignore