From 38bc52ac8cef7f93e0ec702e1af2f32fbab1cc11 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 25 Mar 2021 07:28:20 +0000 Subject: [PATCH] CodeGen from PR 13625 in Azure/azure-rest-api-specs Merge 8f51119fc5b31760e5200b0797761d5fbba4d4ef into f14ad9b7795d786d8f6d584a2455c54b96c816b2 --- .../apimanagement/_api_management_client.py | 20 + .../mgmt/apimanagement/_configuration.py | 2 +- .../azure/mgmt/apimanagement/_metadata.json | 132 ++ .../azure/mgmt/apimanagement/_version.py | 2 +- .../aio/_api_management_client.py | 20 + .../mgmt/apimanagement/aio/_configuration.py | 2 +- .../apimanagement/aio/operations/__init__.py | 8 + .../operations/_api_diagnostic_operations.py | 12 +- .../aio/operations/_api_export_operations.py | 2 +- .../_api_issue_attachment_operations.py | 10 +- .../_api_issue_comment_operations.py | 10 +- .../aio/operations/_api_issue_operations.py | 12 +- .../_api_management_operations_operations.py | 5 +- .../_api_management_service_operations.py | 78 +- ..._api_management_service_skus_operations.py | 2 +- .../_api_management_skus_operations.py | 109 ++ .../operations/_api_operation_operations.py | 12 +- .../_api_operation_policy_operations.py | 10 +- .../aio/operations/_api_operations.py | 14 +- .../aio/operations/_api_policy_operations.py | 10 +- .../aio/operations/_api_product_operations.py | 2 +- .../aio/operations/_api_release_operations.py | 12 +- .../operations/_api_revision_operations.py | 2 +- .../aio/operations/_api_schema_operations.py | 10 +- .../_api_tag_description_operations.py | 10 +- .../operations/_api_version_set_operations.py | 12 +- .../_authorization_server_operations.py | 14 +- .../aio/operations/_backend_operations.py | 14 +- .../aio/operations/_cache_operations.py | 12 +- .../aio/operations/_certificate_operations.py | 82 +- .../operations/_content_item_operations.py | 10 +- .../operations/_content_type_operations.py | 8 +- .../_delegation_settings_operations.py | 10 +- .../_deleted_services_operations.py | 94 +- .../aio/operations/_diagnostic_operations.py | 12 +- .../operations/_email_template_operations.py | 12 +- .../aio/operations/_gateway_api_operations.py | 8 +- ...ateway_certificate_authority_operations.py | 441 +++++ ...teway_hostname_configuration_operations.py | 10 +- .../aio/operations/_gateway_operations.py | 18 +- .../aio/operations/_group_operations.py | 12 +- .../aio/operations/_group_user_operations.py | 8 +- .../_identity_provider_operations.py | 14 +- .../aio/operations/_issue_operations.py | 4 +- .../aio/operations/_logger_operations.py | 12 +- .../aio/operations/_named_value_operations.py | 149 +- .../operations/_network_status_operations.py | 4 +- .../operations/_notification_operations.py | 6 +- ...notification_recipient_email_operations.py | 8 +- ..._notification_recipient_user_operations.py | 8 +- .../_open_id_connect_provider_operations.py | 14 +- .../aio/operations/_operation_operations.py | 5 +- .../_policy_description_operations.py | 2 +- .../aio/operations/_policy_operations.py | 10 +- .../operations/_portal_revision_operations.py | 10 +- .../operations/_portal_settings_operations.py | 100 ++ .../aio/operations/_product_api_operations.py | 8 +- .../operations/_product_group_operations.py | 8 +- .../aio/operations/_product_operations.py | 14 +- .../operations/_product_policy_operations.py | 10 +- .../_product_subscriptions_operations.py | 2 +- .../_quota_by_counter_keys_operations.py | 4 +- .../_quota_by_period_keys_operations.py | 4 +- .../aio/operations/_region_operations.py | 2 +- .../aio/operations/_reports_operations.py | 40 +- .../_sign_in_settings_operations.py | 8 +- .../_sign_up_settings_operations.py | 8 +- .../operations/_subscription_operations.py | 18 +- .../aio/operations/_tag_operations.py | 42 +- .../operations/_tag_resource_operations.py | 2 +- .../_tenant_access_git_operations.py | 134 +- .../operations/_tenant_access_operations.py | 183 +- .../_tenant_configuration_operations.py | 11 +- .../operations/_tenant_settings_operations.py | 187 ++ .../_user_confirmation_password_operations.py | 2 +- .../aio/operations/_user_group_operations.py | 2 +- .../operations/_user_identities_operations.py | 2 +- .../aio/operations/_user_operations.py | 16 +- .../_user_subscription_operations.py | 72 +- .../mgmt/apimanagement/models/__init__.py | 75 + .../models/_api_management_client_enums.py | 57 +- .../mgmt/apimanagement/models/_models.py | 1184 ++++++++++++- .../mgmt/apimanagement/models/_models_py3.py | 1573 ++++++++++++++--- .../mgmt/apimanagement/operations/__init__.py | 8 + .../operations/_api_diagnostic_operations.py | 12 +- .../operations/_api_export_operations.py | 2 +- .../_api_issue_attachment_operations.py | 10 +- .../_api_issue_comment_operations.py | 10 +- .../operations/_api_issue_operations.py | 12 +- .../_api_management_operations_operations.py | 5 +- .../_api_management_service_operations.py | 79 +- ..._api_management_service_skus_operations.py | 2 +- .../_api_management_skus_operations.py | 114 ++ .../operations/_api_operation_operations.py | 12 +- .../_api_operation_policy_operations.py | 10 +- .../operations/_api_operations.py | 14 +- .../operations/_api_policy_operations.py | 10 +- .../operations/_api_product_operations.py | 2 +- .../operations/_api_release_operations.py | 12 +- .../operations/_api_revision_operations.py | 2 +- .../operations/_api_schema_operations.py | 10 +- .../_api_tag_description_operations.py | 10 +- .../operations/_api_version_set_operations.py | 12 +- .../_authorization_server_operations.py | 14 +- .../operations/_backend_operations.py | 14 +- .../operations/_cache_operations.py | 12 +- .../operations/_certificate_operations.py | 83 +- .../operations/_content_item_operations.py | 10 +- .../operations/_content_type_operations.py | 8 +- .../_delegation_settings_operations.py | 10 +- .../_deleted_services_operations.py | 95 +- .../operations/_diagnostic_operations.py | 12 +- .../operations/_email_template_operations.py | 12 +- .../operations/_gateway_api_operations.py | 8 +- ...ateway_certificate_authority_operations.py | 450 +++++ ...teway_hostname_configuration_operations.py | 10 +- .../operations/_gateway_operations.py | 18 +- .../operations/_group_operations.py | 12 +- .../operations/_group_user_operations.py | 8 +- .../_identity_provider_operations.py | 14 +- .../operations/_issue_operations.py | 4 +- .../operations/_logger_operations.py | 12 +- .../operations/_named_value_operations.py | 151 +- .../operations/_network_status_operations.py | 4 +- .../operations/_notification_operations.py | 6 +- ...notification_recipient_email_operations.py | 8 +- ..._notification_recipient_user_operations.py | 8 +- .../_open_id_connect_provider_operations.py | 14 +- .../operations/_operation_operations.py | 5 +- .../_policy_description_operations.py | 2 +- .../operations/_policy_operations.py | 10 +- .../operations/_portal_revision_operations.py | 10 +- .../operations/_portal_settings_operations.py | 105 ++ .../operations/_product_api_operations.py | 8 +- .../operations/_product_group_operations.py | 8 +- .../operations/_product_operations.py | 14 +- .../operations/_product_policy_operations.py | 10 +- .../_product_subscriptions_operations.py | 2 +- .../_quota_by_counter_keys_operations.py | 4 +- .../_quota_by_period_keys_operations.py | 4 +- .../operations/_region_operations.py | 2 +- .../operations/_reports_operations.py | 40 +- .../_sign_in_settings_operations.py | 8 +- .../_sign_up_settings_operations.py | 8 +- .../operations/_subscription_operations.py | 18 +- .../operations/_tag_operations.py | 42 +- .../operations/_tag_resource_operations.py | 2 +- .../_tenant_access_git_operations.py | 136 +- .../operations/_tenant_access_operations.py | 185 +- .../_tenant_configuration_operations.py | 11 +- .../operations/_tenant_settings_operations.py | 193 ++ .../_user_confirmation_password_operations.py | 2 +- .../operations/_user_group_operations.py | 2 +- .../operations/_user_identities_operations.py | 2 +- .../operations/_user_operations.py | 16 +- .../_user_subscription_operations.py | 73 +- 156 files changed, 6315 insertions(+), 1251 deletions(-) create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_metadata.json create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_settings_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_settings_operations.py 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..b3004d2170b2 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 = "2021-01-01-preview" 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/_metadata.json b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_metadata.json new file mode 100644 index 000000000000..9bbebd9a44ab --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_metadata.json @@ -0,0 +1,132 @@ +{ + "chosen_version": "2021-01-01-preview", + "total_api_version_list": ["2021-01-01-preview"], + "client": { + "name": "ApiManagementClient", + "filename": "_api_management_client", + "description": "ApiManagement Client.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential, # type: \"AsyncTokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id" + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null + }, + "operation_groups": { + "api": "ApiOperations", + "api_revision": "ApiRevisionOperations", + "api_release": "ApiReleaseOperations", + "api_operation": "ApiOperationOperations", + "api_operation_policy": "ApiOperationPolicyOperations", + "tag": "TagOperations", + "api_product": "ApiProductOperations", + "api_policy": "ApiPolicyOperations", + "api_schema": "ApiSchemaOperations", + "api_diagnostic": "ApiDiagnosticOperations", + "api_issue": "ApiIssueOperations", + "api_issue_comment": "ApiIssueCommentOperations", + "api_issue_attachment": "ApiIssueAttachmentOperations", + "api_tag_description": "ApiTagDescriptionOperations", + "operation": "OperationOperations", + "api_export": "ApiExportOperations", + "api_version_set": "ApiVersionSetOperations", + "authorization_server": "AuthorizationServerOperations", + "backend": "BackendOperations", + "cache": "CacheOperations", + "certificate": "CertificateOperations", + "content_type": "ContentTypeOperations", + "content_item": "ContentItemOperations", + "deleted_services": "DeletedServicesOperations", + "api_management_operations": "ApiManagementOperationsOperations", + "api_management_service_skus": "ApiManagementServiceSkusOperations", + "api_management_service": "ApiManagementServiceOperations", + "diagnostic": "DiagnosticOperations", + "email_template": "EmailTemplateOperations", + "gateway": "GatewayOperations", + "gateway_hostname_configuration": "GatewayHostnameConfigurationOperations", + "gateway_api": "GatewayApiOperations", + "gateway_certificate_authority": "GatewayCertificateAuthorityOperations", + "group": "GroupOperations", + "group_user": "GroupUserOperations", + "identity_provider": "IdentityProviderOperations", + "issue": "IssueOperations", + "logger": "LoggerOperations", + "named_value": "NamedValueOperations", + "network_status": "NetworkStatusOperations", + "notification": "NotificationOperations", + "notification_recipient_user": "NotificationRecipientUserOperations", + "notification_recipient_email": "NotificationRecipientEmailOperations", + "open_id_connect_provider": "OpenIdConnectProviderOperations", + "policy": "PolicyOperations", + "policy_description": "PolicyDescriptionOperations", + "portal_revision": "PortalRevisionOperations", + "portal_settings": "PortalSettingsOperations", + "sign_in_settings": "SignInSettingsOperations", + "sign_up_settings": "SignUpSettingsOperations", + "delegation_settings": "DelegationSettingsOperations", + "product": "ProductOperations", + "product_api": "ProductApiOperations", + "product_group": "ProductGroupOperations", + "product_subscriptions": "ProductSubscriptionsOperations", + "product_policy": "ProductPolicyOperations", + "quota_by_counter_keys": "QuotaByCounterKeysOperations", + "quota_by_period_keys": "QuotaByPeriodKeysOperations", + "region": "RegionOperations", + "reports": "ReportsOperations", + "tenant_settings": "TenantSettingsOperations", + "api_management_skus": "ApiManagementSkusOperations", + "subscription": "SubscriptionOperations", + "tag_resource": "TagResourceOperations", + "tenant_access": "TenantAccessOperations", + "tenant_access_git": "TenantAccessGitOperations", + "tenant_configuration": "TenantConfigurationOperations", + "user": "UserOperations", + "user_group": "UserGroupOperations", + "user_subscription": "UserSubscriptionOperations", + "user_identities": "UserIdentitiesOperations", + "user_confirmation_password": "UserConfirmationPasswordOperations" + }, + "operation_mixins": { + }, + "sync_imports": "None", + "async_imports": "None" +} \ No newline at end of file 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..eae7c95b6fbd 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 = "0.1.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..cd29302154e8 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 = "2021-01-01-preview" 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..020fab95a62c 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..df632a6f7cb1 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 = "2021-01-01-preview" 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..1885e5fe32ee 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..a5b966b883d4 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..7a6da8ab28a9 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..2a0b1d9f6a78 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 = "2021-01-01-preview" 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..b04c45a41d91 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" 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..4e0a24fc009d 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 = "2021-01-01-preview" 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..4e4909eaf4a5 --- /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 = "2021-01-01-preview" + 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..b9fc39f722c8 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..dd2b0c24a6b7 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..4a43d5e1e029 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..0c0bcdc9cdaa 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..0966f8f79b13 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 = "2021-01-01-preview" 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..c4db8ecffaa5 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..1c75e98f2221 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 = "2021-01-01-preview" 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..7ef40d24c46d 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..2948f5df2a4b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..0901d6ca5dd7 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..8741e24333a5 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..d4fe52539639 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..8c738a1db7cf 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..5ca456e01374 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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..dab00683cbfc 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..c4c578003202 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..fb47d23cfddf 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..689be71e75c9 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..5764f5977965 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..b84caa232870 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..480b828feea8 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..fce46ac2862b --- /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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" + 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 = "2021-01-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])?$'), + '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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" + 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..079470a7f6a0 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..f0e5b0475653 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..a70eab1e597d 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..05c8fb14a78b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..0b927c3e6813 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..0b1588f572c3 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..a239db3ccd6b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..f3e57c8c1d51 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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..ab9edce419ab 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..32179f7d8ef5 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..9230e5193d50 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..8dc7b6a62b7e 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..e0aa8dc7f86b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..86123d904812 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 = "2021-01-01-preview" 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..18e54fdb4b4a 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 = "2021-01-01-preview" 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..b181b0480266 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..60022354e2a3 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..d7ae07bcfb59 --- /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 = "2021-01-01-preview" + 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..fc298fb1f1da 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..0aabbd9283b3 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..afb690540689 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..38da01f0ab1b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..d8285274c360 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 = "2021-01-01-preview" 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..686f128c0856 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..69f414427eab 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..88bde62901f8 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 = "2021-01-01-preview" 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..a85f66156410 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..7e7670ed5662 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..07d689f26beb 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..2a3d9a9eabb8 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..506b16313430 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..36d15f693fe6 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 = "2021-01-01-preview" 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..4295c5bba53b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..822cffff5935 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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..655fa41a61da 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..47b81e3a7527 --- /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 = "2021-01-01-preview" + 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 = "2021-01-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'), + '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..c5d3ae149274 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 = "2021-01-01-preview" 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..b70a17f5cbd2 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 = "2021-01-01-preview" 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..48ed36542154 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 = "2021-01-01-preview" 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..781f00da91e7 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..7f5bf756e272 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 = "2021-01-01-preview" 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 = "2021-01-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])?$'), + '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..53e73b54caf8 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,10 +7,14 @@ # -------------------------------------------------------------------------- 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 + from ._models_py3 import ApiContactInformation from ._models_py3 import ApiContract from ._models_py3 import ApiContractProperties from ._models_py3 import ApiContractUpdateProperties @@ -20,10 +24,12 @@ from ._models_py3 import ApiEntityBaseContract from ._models_py3 import ApiExportResult from ._models_py3 import ApiExportResultValue + from ._models_py3 import ApiLicenseInformation from ._models_py3 import ApiManagementServiceApplyNetworkConfigurationParameters 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 +39,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 +115,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 +197,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 +257,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,10 +277,14 @@ 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 + from ._models import ApiContactInformation # type: ignore from ._models import ApiContract # type: ignore from ._models import ApiContractProperties # type: ignore from ._models import ApiContractUpdateProperties # type: ignore @@ -269,10 +294,12 @@ from ._models import ApiEntityBaseContract # type: ignore from ._models import ApiExportResult # type: ignore from ._models import ApiExportResultValue # type: ignore + from ._models import ApiLicenseInformation # type: ignore from ._models import ApiManagementServiceApplyNetworkConfigurationParameters # type: ignore 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 +309,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 +385,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 +467,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 +527,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 +550,9 @@ from ._api_management_client_enums import ( AccessIdName, AlwaysLog, + ApiManagementSkuCapacityScaleType, + ApiManagementSkuRestrictionsReasonCode, + ApiManagementSkuRestrictionsType, ApiType, ApiVersionSetContractDetailsVersioningScheme, ApimIdentityType, @@ -518,6 +563,8 @@ BearerTokenSendingMethod, BearerTokenSendingMethods, CertificateConfigurationStoreName, + CertificateSource, + CertificateStatus, ClientAuthenticationMethod, ConfigurationIdName, Confirmation, @@ -546,6 +593,7 @@ Protocol, ResourceSkuCapacityScaleType, SamplingType, + SettingsTypeName, SkuType, SoapApiType, State, @@ -558,10 +606,14 @@ ) __all__ = [ + 'AccessInformationCollection', 'AccessInformationContract', + 'AccessInformationCreateParameters', + 'AccessInformationSecretsContract', 'AccessInformationUpdateParameters', 'AdditionalLocation', 'ApiCollection', + 'ApiContactInformation', 'ApiContract', 'ApiContractProperties', 'ApiContractUpdateProperties', @@ -571,10 +623,12 @@ 'ApiEntityBaseContract', 'ApiExportResult', 'ApiExportResultValue', + 'ApiLicenseInformation', 'ApiManagementServiceApplyNetworkConfigurationParameters', 'ApiManagementServiceBackupRestoreParameters', 'ApiManagementServiceBaseProperties', 'ApiManagementServiceCheckNameAvailabilityParameters', + 'ApiManagementServiceGetDomainOwnershipIdentifierResult', 'ApiManagementServiceGetSsoTokenResult', 'ApiManagementServiceIdentity', 'ApiManagementServiceListResult', @@ -584,6 +638,15 @@ 'ApiManagementServiceSkuProperties', 'ApiManagementServiceUpdateParameters', 'ApiManagementServiceUpdateProperties', + 'ApiManagementSku', + 'ApiManagementSkuCapabilities', + 'ApiManagementSkuCapacity', + 'ApiManagementSkuCosts', + 'ApiManagementSkuLocationInfo', + 'ApiManagementSkuRestrictionInfo', + 'ApiManagementSkuRestrictions', + 'ApiManagementSkuZoneDetails', + 'ApiManagementSkusResult', 'ApiReleaseCollection', 'ApiReleaseContract', 'ApiRevisionCollection', @@ -651,6 +714,8 @@ 'ErrorFieldContract', 'ErrorResponse', 'ErrorResponseBody', + 'GatewayCertificateAuthorityCollection', + 'GatewayCertificateAuthorityContract', 'GatewayCollection', 'GatewayContract', 'GatewayHostnameConfigurationCollection', @@ -731,6 +796,8 @@ 'PortalRevisionCollection', 'PortalRevisionContract', 'PortalSettingValidationKeyContract', + 'PortalSettingsCollection', + 'PortalSettingsContract', 'PortalSigninSettings', 'PortalSignupSettings', 'ProductCollection', @@ -789,6 +856,8 @@ 'TagResourceContract', 'TagResourceContractProperties', 'TenantConfigurationSyncStateContract', + 'TenantSettingsCollection', + 'TenantSettingsContract', 'TermsOfServiceProperties', 'TokenBodyParameterContract', 'UserCollection', @@ -808,6 +877,9 @@ 'X509CertificateName', 'AccessIdName', 'AlwaysLog', + 'ApiManagementSkuCapacityScaleType', + 'ApiManagementSkuRestrictionsReasonCode', + 'ApiManagementSkuRestrictionsType', 'ApiType', 'ApiVersionSetContractDetailsVersioningScheme', 'ApimIdentityType', @@ -818,6 +890,8 @@ 'BearerTokenSendingMethod', 'BearerTokenSendingMethods', 'CertificateConfigurationStoreName', + 'CertificateSource', + 'CertificateStatus', 'ClientAuthenticationMethod', 'ConfigurationIdName', 'Confirmation', @@ -846,6 +920,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..09d1874b4471 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 @@ -53,9 +76,10 @@ class ApiType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): HTTP = "http" SOAP = "soap" + WEBSOCKET = "websocket" 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" @@ -114,6 +138,23 @@ class CertificateConfigurationStoreName(with_metaclass(_CaseInsensitiveEnumMeta, CERTIFICATE_AUTHORITY = "CertificateAuthority" ROOT = "Root" +class CertificateSource(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Certificate Source. + """ + + MANAGED = "Managed" + KEY_VAULT = "KeyVault" + CUSTOM = "Custom" + BUILT_IN = "BuiltIn" + +class CertificateStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Certificate Status. + """ + + COMPLETED = "Completed" + FAILED = "Failed" + IN_PROGRESS = "InProgress" + class ClientAuthenticationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): BASIC = "Basic" #: Basic Client Authentication method. @@ -314,6 +355,8 @@ class Protocol(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): HTTP = "http" HTTPS = "https" + WS = "ws" + WSS = "wss" class ResourceSkuCapacityScaleType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The scale type applicable to the sku. @@ -329,6 +372,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. """ @@ -344,12 +391,14 @@ class SoapApiType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Type of Api to create. - * ``http`` creates a SOAP to REST API - * ``soap`` creates a SOAP pass-through API . + * ``http`` creates a REST API + * ``soap`` creates a SOAP pass-through API + * ``websocket`` creates websocket API. """ SOAP_TO_REST = "http" #: Imports a SOAP API having a RESTful front end. SOAP_PASS_THROUGH = "soap" #: Imports the Soap API having a SOAP front end. + WEB_SOCKET = "websocket" #: Imports the Soap API having a Websocket front end. class State(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Status of the issue. @@ -413,7 +462,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..9a6b87c5a1bf 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) @@ -84,6 +234,10 @@ class AdditionalLocation(msrest.serialization.Model): service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard, Premium and Isolated SKU. :vartype private_ip_addresses: list[str] + :param public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the location. Supported only for Premium SKU being deployed + in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration for the location. :type virtual_network_configuration: ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration @@ -108,6 +262,7 @@ class AdditionalLocation(msrest.serialization.Model): 'zones': {'key': 'zones', 'type': '[str]'}, 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, 'disable_gateway': {'key': 'disableGateway', 'type': 'bool'}, @@ -123,6 +278,7 @@ def __init__( self.zones = kwargs.get('zones', None) self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = kwargs.get('public_ip_address_id', None) self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) self.gateway_regional_url = None self.disable_gateway = kwargs.get('disable_gateway', False) @@ -135,6 +291,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 +304,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,42 +314,36 @@ 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. +class ApiContactInformation(msrest.serialization.Model): + """API contact information. - :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 name: The identifying name of the contact person/organization. + :type name: str + :param url: The URL pointing to the contact information. MUST be in the format of a URL. + :type url: str + :param email: The email address of the contact person/organization. MUST be in the format of an + email address. + :type email: 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'}, + 'url': {'key': 'url', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, } def __init__( self, **kwargs ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(ApiContactInformation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.url = kwargs.get('url', None) + self.email = kwargs.get('email', None) class ApiContract(Resource): @@ -211,7 +364,7 @@ class ApiContract(Resource): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -231,6 +384,13 @@ class ApiContract(Resource): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -278,6 +438,9 @@ class ApiContract(Resource): 'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'properties.termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'properties.license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'properties.sourceApiId', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, @@ -303,6 +466,9 @@ def __init__( self.api_version_description = kwargs.get('api_version_description', None) self.api_version_set_id = kwargs.get('api_version_set_id', None) self.subscription_required = kwargs.get('subscription_required', None) + self.terms_of_service_url = kwargs.get('terms_of_service_url', None) + self.contact = kwargs.get('contact', None) + self.license = kwargs.get('license', None) self.source_api_id = kwargs.get('source_api_id', None) self.display_name = kwargs.get('display_name', None) self.service_url = kwargs.get('service_url', None) @@ -323,7 +489,7 @@ class ApiEntityBaseContract(msrest.serialization.Model): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -343,6 +509,13 @@ class ApiEntityBaseContract(msrest.serialization.Model): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation """ _validation = { @@ -366,6 +539,9 @@ class ApiEntityBaseContract(msrest.serialization.Model): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, } def __init__( @@ -385,6 +561,9 @@ def __init__( self.api_version_description = kwargs.get('api_version_description', None) self.api_version_set_id = kwargs.get('api_version_set_id', None) self.subscription_required = kwargs.get('subscription_required', None) + self.terms_of_service_url = kwargs.get('terms_of_service_url', None) + self.contact = kwargs.get('contact', None) + self.license = kwargs.get('license', None) class ApiContractProperties(ApiEntityBaseContract): @@ -401,7 +580,7 @@ class ApiContractProperties(ApiEntityBaseContract): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -421,6 +600,13 @@ class ApiContractProperties(ApiEntityBaseContract): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -462,6 +648,9 @@ class ApiContractProperties(ApiEntityBaseContract): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'sourceApiId', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, @@ -495,7 +684,7 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -515,6 +704,13 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param display_name: API name. :type display_name: str :param service_url: Absolute URL of the backend service implementing this API. @@ -551,6 +747,9 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, @@ -580,7 +779,7 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -600,6 +799,13 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -626,8 +832,9 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): :param soap_api_type: Type of Api to create. - * ``http`` creates a SOAP to REST API - * ``soap`` creates a SOAP pass-through API . Possible values include: "http", "soap". + * ``http`` creates a REST API + * ``soap`` creates a SOAP pass-through API + * ``websocket`` creates websocket API. Possible values include: "http", "soap", "websocket". :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ @@ -655,6 +862,9 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): 'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'properties.termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'properties.license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'properties.sourceApiId', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, @@ -684,6 +894,9 @@ def __init__( self.api_version_description = kwargs.get('api_version_description', None) self.api_version_set_id = kwargs.get('api_version_set_id', None) self.subscription_required = kwargs.get('subscription_required', None) + self.terms_of_service_url = kwargs.get('terms_of_service_url', None) + self.contact = kwargs.get('contact', None) + self.license = kwargs.get('license', None) self.source_api_id = kwargs.get('source_api_id', None) self.display_name = kwargs.get('display_name', None) self.service_url = kwargs.get('service_url', None) @@ -710,7 +923,7 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -730,6 +943,13 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -756,8 +976,9 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): :param soap_api_type: Type of Api to create. - * ``http`` creates a SOAP to REST API - * ``soap`` creates a SOAP pass-through API . Possible values include: "http", "soap". + * ``http`` creates a REST API + * ``soap`` creates a SOAP pass-through API + * ``websocket`` creates websocket API. Possible values include: "http", "soap", "websocket". :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ @@ -785,6 +1006,9 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'sourceApiId', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, @@ -880,6 +1104,29 @@ def __init__( self.link = kwargs.get('link', None) +class ApiLicenseInformation(msrest.serialization.Model): + """API license information. + + :param name: The license name used for the API. + :type name: str + :param url: A URL to the license used for the API. MUST be in the format of a URL. + :type url: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ApiLicenseInformation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.url = kwargs.get('url', None) + + class ApiManagementServiceApplyNetworkConfigurationParameters(msrest.serialization.Model): """Parameter supplied to the Apply Network configuration operation. @@ -981,6 +1228,10 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -1069,6 +1320,7 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, @@ -1098,6 +1350,7 @@ def __init__( self.hostname_configurations = kwargs.get('hostname_configurations', None) self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = kwargs.get('public_ip_address_id', None) self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) self.additional_locations = kwargs.get('additional_locations', None) self.custom_properties = kwargs.get('custom_properties', None) @@ -1134,6 +1387,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. @@ -1313,6 +1591,10 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -1407,6 +1689,7 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, @@ -1526,6 +1809,10 @@ class ApiManagementServiceResource(ApimResource): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -1635,6 +1922,7 @@ class ApiManagementServiceResource(ApimResource): 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'properties.publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, @@ -1671,6 +1959,7 @@ def __init__( self.hostname_configurations = kwargs.get('hostname_configurations', None) self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = kwargs.get('public_ip_address_id', None) self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) self.additional_locations = kwargs.get('additional_locations', None) self.custom_properties = kwargs.get('custom_properties', None) @@ -1768,6 +2057,10 @@ class ApiManagementServiceUpdateParameters(ApimResource): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -1873,6 +2166,7 @@ class ApiManagementServiceUpdateParameters(ApimResource): 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'properties.publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, @@ -1907,6 +2201,7 @@ def __init__( self.hostname_configurations = kwargs.get('hostname_configurations', None) self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = kwargs.get('public_ip_address_id', None) self.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) self.additional_locations = kwargs.get('additional_locations', None) self.custom_properties = kwargs.get('custom_properties', None) @@ -1958,6 +2253,10 @@ class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -2052,6 +2351,7 @@ class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, @@ -2074,6 +2374,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 +2748,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 +2761,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 +2771,7 @@ def __init__( ): super(ApiReleaseCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -2162,6 +2833,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 +2846,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 +2856,7 @@ def __init__( ): super(ApiRevisionCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -2295,7 +2970,7 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -2315,6 +2990,13 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param id: API identifier in the form /apis/{apiId}. :type id: str :param name: API name. @@ -2353,6 +3035,9 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, @@ -2384,7 +3069,7 @@ class ApiUpdateContract(msrest.serialization.Model): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -2404,6 +3089,13 @@ class ApiUpdateContract(msrest.serialization.Model): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param display_name: API name. :type display_name: str :param service_url: Absolute URL of the backend service implementing this API. @@ -2440,6 +3132,9 @@ class ApiUpdateContract(msrest.serialization.Model): 'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'properties.termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'properties.license', 'type': 'ApiLicenseInformation'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, 'path': {'key': 'properties.path', 'type': 'str'}, @@ -2463,6 +3158,9 @@ def __init__( self.api_version_description = kwargs.get('api_version_description', None) self.api_version_set_id = kwargs.get('api_version_set_id', None) self.subscription_required = kwargs.get('subscription_required', None) + self.terms_of_service_url = kwargs.get('terms_of_service_url', None) + self.contact = kwargs.get('contact', None) + self.license = kwargs.get('license', None) self.display_name = kwargs.get('display_name', None) self.service_url = kwargs.get('service_url', None) self.path = kwargs.get('path', None) @@ -2494,12 +3192,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 +3210,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 +3235,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 +3282,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 +3365,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 +3407,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 +3451,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 +4181,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 +4199,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 +4335,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 +4349,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 +4366,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 +4469,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 +4487,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 +4504,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 +4676,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 +4694,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 +4795,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 +4813,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 +5355,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 +5373,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 +5455,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 +5473,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) @@ -4936,32 +5667,98 @@ def __init__( self.details = kwargs.get('details', None) -class ErrorResponseBody(msrest.serialization.Model): - """Error Body contract. +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 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 +5768,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 +5781,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 +5791,7 @@ def __init__( ): super(GatewayCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -5247,12 +6048,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 +6066,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) @@ -5479,6 +6284,12 @@ class HostnameConfiguration(msrest.serialization.Model): :type negotiate_client_certificate: bool :param certificate: Certificate information. :type certificate: ~azure.mgmt.apimanagement.models.CertificateInformation + :param certificate_source: Certificate Source. Possible values include: "Managed", "KeyVault", + "Custom", "BuiltIn". + :type certificate_source: str or ~azure.mgmt.apimanagement.models.CertificateSource + :param certificate_status: Certificate Status. Possible values include: "Completed", "Failed", + "InProgress". + :type certificate_status: str or ~azure.mgmt.apimanagement.models.CertificateStatus """ _validation = { @@ -5496,6 +6307,8 @@ class HostnameConfiguration(msrest.serialization.Model): 'default_ssl_binding': {'key': 'defaultSslBinding', 'type': 'bool'}, 'negotiate_client_certificate': {'key': 'negotiateClientCertificate', 'type': 'bool'}, 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'certificate_status': {'key': 'certificateStatus', 'type': 'str'}, } def __init__( @@ -5512,6 +6325,8 @@ def __init__( self.default_ssl_binding = kwargs.get('default_ssl_binding', False) self.negotiate_client_certificate = kwargs.get('negotiate_client_certificate', False) self.certificate = kwargs.get('certificate', None) + self.certificate_source = kwargs.get('certificate_source', None) + self.certificate_status = kwargs.get('certificate_status', None) class HttpMessageDiagnostic(msrest.serialization.Model): @@ -5908,12 +6723,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 +6741,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 +6886,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 +6899,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 +6909,7 @@ def __init__( ): super(IssueAttachmentCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -6142,6 +6965,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 +6978,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 +6988,7 @@ def __init__( ): super(IssueCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -6172,6 +6999,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 +7012,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 +7022,7 @@ def __init__( ): super(IssueCommentCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -6651,12 +7482,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 +7500,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 +7915,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 +7933,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 +8034,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 +8052,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 +8186,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 +8199,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 +8209,7 @@ def __init__( ): super(OperationCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -7845,6 +8692,10 @@ class ParameterContract(msrest.serialization.Model): :type required: bool :param values: Parameter values. :type values: list[str] + :param schema_id: Schema identifier. + :type schema_id: str + :param type_name: Type name defined by the schema. + :type type_name: str """ _validation = { @@ -7859,6 +8710,8 @@ class ParameterContract(msrest.serialization.Model): 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'required': {'key': 'required', 'type': 'bool'}, 'values': {'key': 'values', 'type': '[str]'}, + 'schema_id': {'key': 'schemaId', 'type': 'str'}, + 'type_name': {'key': 'typeName', 'type': 'str'}, } def __init__( @@ -7872,6 +8725,8 @@ def __init__( self.default_value = kwargs.get('default_value', None) self.required = kwargs.get('required', None) self.values = kwargs.get('values', None) + self.schema_id = kwargs.get('schema_id', None) + self.type_name = kwargs.get('type_name', None) class PipelineDiagnosticSettings(msrest.serialization.Model): @@ -7902,12 +8757,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 +8775,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 +8857,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 +8873,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 +9027,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 +9208,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 +9226,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 +9275,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 +9338,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 +9399,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 +9459,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 +9517,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 +9579,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 +9749,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 +9767,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 +9835,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 +9853,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 +10594,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 +10607,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 +10617,7 @@ def __init__( ): super(SchemaCollection, self).__init__(**kwargs) self.value = None + self.count = kwargs.get('count', None) self.next_link = None @@ -9720,12 +10676,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 +10694,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 +11010,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 +11028,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 +11128,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 +11146,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 +11277,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 +11295,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 +11410,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 +11538,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 +11556,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..2e9522a2e5ae 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 @@ -96,6 +258,10 @@ class AdditionalLocation(msrest.serialization.Model): service which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, Standard, Premium and Isolated SKU. :vartype private_ip_addresses: list[str] + :param public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the location. Supported only for Premium SKU being deployed + in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration for the location. :type virtual_network_configuration: ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration @@ -120,6 +286,7 @@ class AdditionalLocation(msrest.serialization.Model): 'zones': {'key': 'zones', 'type': '[str]'}, 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'gateway_regional_url': {'key': 'gatewayRegionalUrl', 'type': 'str'}, 'disable_gateway': {'key': 'disableGateway', 'type': 'bool'}, @@ -131,6 +298,7 @@ def __init__( location: str, sku: "ApiManagementServiceSkuProperties", zones: Optional[List[str]] = None, + public_ip_address_id: Optional[str] = None, virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, disable_gateway: Optional[bool] = False, **kwargs @@ -141,6 +309,7 @@ def __init__( self.zones = zones self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = public_ip_address_id self.virtual_network_configuration = virtual_network_configuration self.gateway_regional_url = None self.disable_gateway = disable_gateway @@ -153,6 +322,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,51 +335,52 @@ 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. +class ApiContactInformation(msrest.serialization.Model): + """API contact information. - :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 name: The identifying name of the contact person/organization. + :type name: str + :param url: The URL pointing to the contact information. MUST be in the format of a URL. + :type url: str + :param email: The email address of the contact person/organization. MUST be in the format of an + email address. + :type email: 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'}, + 'url': {'key': 'url', 'type': 'str'}, + 'email': {'key': 'email', 'type': 'str'}, } def __init__( self, + *, + name: Optional[str] = None, + url: Optional[str] = None, + email: Optional[str] = None, **kwargs ): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + super(ApiContactInformation, self).__init__(**kwargs) + self.name = name + self.url = url + self.email = email class ApiContract(Resource): @@ -229,7 +401,7 @@ class ApiContract(Resource): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -249,6 +421,13 @@ class ApiContract(Resource): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -296,6 +475,9 @@ class ApiContract(Resource): 'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'properties.termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'properties.license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'properties.sourceApiId', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, @@ -318,6 +500,9 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, source_api_id: Optional[str] = None, display_name: Optional[str] = None, service_url: Optional[str] = None, @@ -339,6 +524,9 @@ def __init__( self.api_version_description = api_version_description self.api_version_set_id = api_version_set_id self.subscription_required = subscription_required + self.terms_of_service_url = terms_of_service_url + self.contact = contact + self.license = license self.source_api_id = source_api_id self.display_name = display_name self.service_url = service_url @@ -359,7 +547,7 @@ class ApiEntityBaseContract(msrest.serialization.Model): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -379,6 +567,13 @@ class ApiEntityBaseContract(msrest.serialization.Model): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation """ _validation = { @@ -402,6 +597,9 @@ class ApiEntityBaseContract(msrest.serialization.Model): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, } def __init__( @@ -418,6 +616,9 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, **kwargs ): super(ApiEntityBaseContract, self).__init__(**kwargs) @@ -433,6 +634,9 @@ def __init__( self.api_version_description = api_version_description self.api_version_set_id = api_version_set_id self.subscription_required = subscription_required + self.terms_of_service_url = terms_of_service_url + self.contact = contact + self.license = license class ApiContractProperties(ApiEntityBaseContract): @@ -449,7 +653,7 @@ class ApiContractProperties(ApiEntityBaseContract): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -469,6 +673,13 @@ class ApiContractProperties(ApiEntityBaseContract): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -510,6 +721,9 @@ class ApiContractProperties(ApiEntityBaseContract): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'sourceApiId', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, @@ -533,6 +747,9 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, source_api_id: Optional[str] = None, display_name: Optional[str] = None, service_url: Optional[str] = None, @@ -540,7 +757,7 @@ def __init__( api_version_set: Optional["ApiVersionSetContractDetails"] = None, **kwargs ): - super(ApiContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, **kwargs) + super(ApiContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, **kwargs) self.source_api_id = source_api_id self.display_name = display_name self.service_url = service_url @@ -561,7 +778,7 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -581,6 +798,13 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param display_name: API name. :type display_name: str :param service_url: Absolute URL of the backend service implementing this API. @@ -617,6 +841,9 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, @@ -637,13 +864,16 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, display_name: Optional[str] = None, service_url: Optional[str] = None, path: Optional[str] = None, protocols: Optional[List[Union[str, "Protocol"]]] = None, **kwargs ): - super(ApiContractUpdateProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, **kwargs) + super(ApiContractUpdateProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, **kwargs) self.display_name = display_name self.service_url = service_url self.path = path @@ -662,7 +892,7 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -682,6 +912,13 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -708,8 +945,9 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): :param soap_api_type: Type of Api to create. - * ``http`` creates a SOAP to REST API - * ``soap`` creates a SOAP pass-through API . Possible values include: "http", "soap". + * ``http`` creates a REST API + * ``soap`` creates a SOAP pass-through API + * ``websocket`` creates websocket API. Possible values include: "http", "soap", "websocket". :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ @@ -737,6 +975,9 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): 'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'properties.termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'properties.license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'properties.sourceApiId', 'type': 'str'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, @@ -763,6 +1004,9 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, source_api_id: Optional[str] = None, display_name: Optional[str] = None, service_url: Optional[str] = None, @@ -788,6 +1032,9 @@ def __init__( self.api_version_description = api_version_description self.api_version_set_id = api_version_set_id self.subscription_required = subscription_required + self.terms_of_service_url = terms_of_service_url + self.contact = contact + self.license = license self.source_api_id = source_api_id self.display_name = display_name self.service_url = service_url @@ -814,7 +1061,7 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -834,6 +1081,13 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param source_api_id: API identifier of the source API. :type source_api_id: str :param display_name: API name. Must be 1 to 300 characters long. @@ -860,8 +1114,9 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): :param soap_api_type: Type of Api to create. - * ``http`` creates a SOAP to REST API - * ``soap`` creates a SOAP pass-through API . Possible values include: "http", "soap". + * ``http`` creates a REST API + * ``soap`` creates a SOAP pass-through API + * ``websocket`` creates websocket API. Possible values include: "http", "soap", "websocket". :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ @@ -889,6 +1144,9 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'source_api_id': {'key': 'sourceApiId', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, @@ -916,6 +1174,9 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, source_api_id: Optional[str] = None, display_name: Optional[str] = None, service_url: Optional[str] = None, @@ -927,7 +1188,7 @@ def __init__( soap_api_type: Optional[Union[str, "SoapApiType"]] = None, **kwargs ): - super(ApiCreateOrUpdateProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, source_api_id=source_api_id, display_name=display_name, service_url=service_url, path=path, protocols=protocols, api_version_set=api_version_set, **kwargs) + super(ApiCreateOrUpdateProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, source_api_id=source_api_id, display_name=display_name, service_url=service_url, path=path, protocols=protocols, api_version_set=api_version_set, **kwargs) self.value = value self.format = format self.wsdl_selector = wsdl_selector @@ -1015,6 +1276,32 @@ def __init__( self.link = link +class ApiLicenseInformation(msrest.serialization.Model): + """API license information. + + :param name: The license name used for the API. + :type name: str + :param url: A URL to the license used for the API. MUST be in the format of a URL. + :type url: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'url': {'key': 'url', 'type': 'str'}, + } + + def __init__( + self, + *, + name: Optional[str] = None, + url: Optional[str] = None, + **kwargs + ): + super(ApiLicenseInformation, self).__init__(**kwargs) + self.name = name + self.url = url + + class ApiManagementServiceApplyNetworkConfigurationParameters(msrest.serialization.Model): """Parameter supplied to the Apply Network configuration operation. @@ -1123,6 +1410,10 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -1211,6 +1502,7 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, @@ -1227,6 +1519,7 @@ def __init__( *, notification_sender_email: Optional[str] = None, hostname_configurations: Optional[List["HostnameConfiguration"]] = None, + public_ip_address_id: Optional[str] = None, virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, additional_locations: Optional[List["AdditionalLocation"]] = None, custom_properties: Optional[Dict[str, str]] = None, @@ -1252,6 +1545,7 @@ def __init__( self.hostname_configurations = hostname_configurations self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = public_ip_address_id self.virtual_network_configuration = virtual_network_configuration self.additional_locations = additional_locations self.custom_properties = custom_properties @@ -1290,6 +1584,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. @@ -1479,6 +1798,10 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -1573,6 +1896,7 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): 'hostname_configurations': {'key': 'hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'customProperties', 'type': '{str}'}, @@ -1593,6 +1917,7 @@ def __init__( publisher_name: str, notification_sender_email: Optional[str] = None, hostname_configurations: Optional[List["HostnameConfiguration"]] = None, + public_ip_address_id: Optional[str] = None, virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, additional_locations: Optional[List["AdditionalLocation"]] = None, custom_properties: Optional[Dict[str, str]] = None, @@ -1604,7 +1929,7 @@ def __init__( restore: Optional[bool] = False, **kwargs ): - super(ApiManagementServiceProperties, 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) + super(ApiManagementServiceProperties, self).__init__(notification_sender_email=notification_sender_email, hostname_configurations=hostname_configurations, public_ip_address_id=public_ip_address_id, 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 @@ -1708,6 +2033,10 @@ class ApiManagementServiceResource(ApimResource): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -1817,6 +2146,7 @@ class ApiManagementServiceResource(ApimResource): 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'properties.publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, @@ -1842,6 +2172,7 @@ def __init__( zones: Optional[List[str]] = None, notification_sender_email: Optional[str] = None, hostname_configurations: Optional[List["HostnameConfiguration"]] = None, + public_ip_address_id: Optional[str] = None, virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, additional_locations: Optional[List["AdditionalLocation"]] = None, custom_properties: Optional[Dict[str, str]] = None, @@ -1872,6 +2203,7 @@ def __init__( self.hostname_configurations = hostname_configurations self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = public_ip_address_id self.virtual_network_configuration = virtual_network_configuration self.additional_locations = additional_locations self.custom_properties = custom_properties @@ -1972,6 +2304,10 @@ class ApiManagementServiceUpdateParameters(ApimResource): 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: str :param virtual_network_configuration: Virtual network configuration of the API Management service. :type virtual_network_configuration: @@ -2077,6 +2413,7 @@ class ApiManagementServiceUpdateParameters(ApimResource): 'hostname_configurations': {'key': 'properties.hostnameConfigurations', 'type': '[HostnameConfiguration]'}, 'public_ip_addresses': {'key': 'properties.publicIPAddresses', 'type': '[str]'}, 'private_ip_addresses': {'key': 'properties.privateIPAddresses', 'type': '[str]'}, + 'public_ip_address_id': {'key': 'properties.publicIpAddressId', 'type': 'str'}, 'virtual_network_configuration': {'key': 'properties.virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, 'additional_locations': {'key': 'properties.additionalLocations', 'type': '[AdditionalLocation]'}, 'custom_properties': {'key': 'properties.customProperties', 'type': '{str}'}, @@ -2098,6 +2435,7 @@ def __init__( identity: Optional["ApiManagementServiceIdentity"] = None, notification_sender_email: Optional[str] = None, hostname_configurations: Optional[List["HostnameConfiguration"]] = None, + public_ip_address_id: Optional[str] = None, virtual_network_configuration: Optional["VirtualNetworkConfiguration"] = None, additional_locations: Optional[List["AdditionalLocation"]] = None, custom_properties: Optional[Dict[str, str]] = None, @@ -2128,6 +2466,7 @@ def __init__( self.hostname_configurations = hostname_configurations self.public_ip_addresses = None self.private_ip_addresses = None + self.public_ip_address_id = public_ip_address_id self.virtual_network_configuration = virtual_network_configuration self.additional_locations = additional_locations self.custom_properties = custom_properties @@ -2141,172 +2480,547 @@ 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 public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with + Virtual Network deployed service in the region. Supported only for Developer and Premium SKU + being deployed in Virtual Network. + :type public_ip_address_id: 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]'}, + 'public_ip_address_id': {'key': 'publicIpAddressId', '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, + public_ip_address_id: Optional[str] = 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, public_ip_address_id=public_ip_address_id, 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 +3030,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 +3043,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 +3120,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 +3133,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 @@ -2538,7 +3264,7 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -2558,6 +3284,13 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param id: API identifier in the form /apis/{apiId}. :type id: str :param name: API name. @@ -2596,6 +3329,9 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): 'api_version_description': {'key': 'apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'license', 'type': 'ApiLicenseInformation'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'service_url': {'key': 'serviceUrl', 'type': 'str'}, @@ -2617,6 +3353,9 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, id: Optional[str] = None, name: Optional[str] = None, service_url: Optional[str] = None, @@ -2624,7 +3363,7 @@ def __init__( protocols: Optional[List[Union[str, "Protocol"]]] = None, **kwargs ): - super(ApiTagResourceContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, **kwargs) + super(ApiTagResourceContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, **kwargs) self.id = id self.name = name self.service_url = service_url @@ -2644,7 +3383,7 @@ class ApiUpdateContract(msrest.serialization.Model): :param subscription_key_parameter_names: Protocols over which API is made available. :type subscription_key_parameter_names: ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract - :param api_type: Type of API. Possible values include: "http", "soap". + :param api_type: Type of API. Possible values include: "http", "soap", "websocket". :type api_type: str or ~azure.mgmt.apimanagement.models.ApiType :param api_revision: Describes the Revision of the Api. If no value is provided, default revision 1 is created. @@ -2664,6 +3403,13 @@ class ApiUpdateContract(msrest.serialization.Model): :param subscription_required: Specifies whether an API or Product subscription is required for accessing the API. :type subscription_required: bool + :param terms_of_service_url: A URL to the Terms of Service for the API. MUST be in the format + of a URL. + :type terms_of_service_url: str + :param contact: Contact information for the API. + :type contact: ~azure.mgmt.apimanagement.models.ApiContactInformation + :param license: License information for the API. + :type license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :param display_name: API name. :type display_name: str :param service_url: Absolute URL of the backend service implementing this API. @@ -2700,6 +3446,9 @@ class ApiUpdateContract(msrest.serialization.Model): 'api_version_description': {'key': 'properties.apiVersionDescription', 'type': 'str'}, 'api_version_set_id': {'key': 'properties.apiVersionSetId', 'type': 'str'}, 'subscription_required': {'key': 'properties.subscriptionRequired', 'type': 'bool'}, + 'terms_of_service_url': {'key': 'properties.termsOfServiceUrl', 'type': 'str'}, + 'contact': {'key': 'properties.contact', 'type': 'ApiContactInformation'}, + 'license': {'key': 'properties.license', 'type': 'ApiLicenseInformation'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'service_url': {'key': 'properties.serviceUrl', 'type': 'str'}, 'path': {'key': 'properties.path', 'type': 'str'}, @@ -2720,6 +3469,9 @@ def __init__( api_version_description: Optional[str] = None, api_version_set_id: Optional[str] = None, subscription_required: Optional[bool] = None, + terms_of_service_url: Optional[str] = None, + contact: Optional["ApiContactInformation"] = None, + license: Optional["ApiLicenseInformation"] = None, display_name: Optional[str] = None, service_url: Optional[str] = None, path: Optional[str] = None, @@ -2739,6 +3491,9 @@ def __init__( self.api_version_description = api_version_description self.api_version_set_id = api_version_set_id self.subscription_required = subscription_required + self.terms_of_service_url = terms_of_service_url + self.contact = contact + self.license = license self.display_name = display_name self.service_url = service_url self.path = path @@ -2772,12 +3527,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 +3543,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 +3574,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 +3627,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 +3721,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 +3769,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 +3819,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 +4656,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 +4672,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 +4834,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 +4848,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 +4863,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 +4871,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 +4982,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 +5000,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 +5015,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 +5221,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 +5237,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 +5354,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 +5370,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 +5967,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 +5983,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 +6081,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 +6097,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 @@ -5557,6 +6353,74 @@ def __init__( 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): """Paged Gateway list representation. @@ -5564,6 +6428,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 +6441,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 +6732,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 +6748,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 @@ -6117,6 +6992,12 @@ class HostnameConfiguration(msrest.serialization.Model): :type negotiate_client_certificate: bool :param certificate: Certificate information. :type certificate: ~azure.mgmt.apimanagement.models.CertificateInformation + :param certificate_source: Certificate Source. Possible values include: "Managed", "KeyVault", + "Custom", "BuiltIn". + :type certificate_source: str or ~azure.mgmt.apimanagement.models.CertificateSource + :param certificate_status: Certificate Status. Possible values include: "Completed", "Failed", + "InProgress". + :type certificate_status: str or ~azure.mgmt.apimanagement.models.CertificateStatus """ _validation = { @@ -6134,6 +7015,8 @@ class HostnameConfiguration(msrest.serialization.Model): 'default_ssl_binding': {'key': 'defaultSslBinding', 'type': 'bool'}, 'negotiate_client_certificate': {'key': 'negotiateClientCertificate', 'type': 'bool'}, 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, + 'certificate_source': {'key': 'certificateSource', 'type': 'str'}, + 'certificate_status': {'key': 'certificateStatus', 'type': 'str'}, } def __init__( @@ -6148,6 +7031,8 @@ def __init__( default_ssl_binding: Optional[bool] = False, negotiate_client_certificate: Optional[bool] = False, certificate: Optional["CertificateInformation"] = None, + certificate_source: Optional[Union[str, "CertificateSource"]] = None, + certificate_status: Optional[Union[str, "CertificateStatus"]] = None, **kwargs ): super(HostnameConfiguration, self).__init__(**kwargs) @@ -6160,6 +7045,8 @@ def __init__( self.default_ssl_binding = default_ssl_binding self.negotiate_client_certificate = negotiate_client_certificate self.certificate = certificate + self.certificate_source = certificate_source + self.certificate_status = certificate_status class HttpMessageDiagnostic(msrest.serialization.Model): @@ -6613,12 +7500,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 +7516,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 +7689,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 +7702,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 +7774,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 +7787,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 +7810,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 +7823,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 +8357,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 +8373,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 +8841,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 +8857,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 +8974,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 +8990,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 +9147,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 +9160,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 @@ -8787,6 +9718,10 @@ class ParameterContract(msrest.serialization.Model): :type required: bool :param values: Parameter values. :type values: list[str] + :param schema_id: Schema identifier. + :type schema_id: str + :param type_name: Type name defined by the schema. + :type type_name: str """ _validation = { @@ -8801,6 +9736,8 @@ class ParameterContract(msrest.serialization.Model): 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'required': {'key': 'required', 'type': 'bool'}, 'values': {'key': 'values', 'type': '[str]'}, + 'schema_id': {'key': 'schemaId', 'type': 'str'}, + 'type_name': {'key': 'typeName', 'type': 'str'}, } def __init__( @@ -8812,6 +9749,8 @@ def __init__( default_value: Optional[str] = None, required: Optional[bool] = None, values: Optional[List[str]] = None, + schema_id: Optional[str] = None, + type_name: Optional[str] = None, **kwargs ): super(ParameterContract, self).__init__(**kwargs) @@ -8821,6 +9760,8 @@ def __init__( self.default_value = default_value self.required = required self.values = values + self.schema_id = schema_id + self.type_name = type_name class PipelineDiagnosticSettings(msrest.serialization.Model): @@ -8854,12 +9795,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 +9811,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 +9905,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 +9921,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 +10083,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 +10281,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 +10297,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 +10352,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 +10423,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 +10491,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 +10559,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 +10626,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 +10696,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 +10893,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 +10909,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 +10988,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 +11004,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 +11843,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 +11856,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 +11931,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 +11947,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 +12308,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 +12324,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 +12438,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 +12454,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 +12607,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 +12623,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 +12760,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 +12897,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 +12913,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..0b377fbc55f6 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..433517555c2e 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 = "2021-01-01-preview" 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..2064a3bc13fe 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..1421fc0c7a00 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..05a5be16cc41 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..264a9d103094 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 = "2021-01-01-preview" 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..93eec356a3ab 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" 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..3a645539c485 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 = "2021-01-01-preview" 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..46ea396522f7 --- /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 = "2021-01-01-preview" + 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..0db5d847ce50 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..2fed8ee7bb4c 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..faa9562dbcd9 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..5267d2bd6797 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..99f55b483f55 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 = "2021-01-01-preview" 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..6d1b8c78cc93 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..121e67824278 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 = "2021-01-01-preview" 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..bdc8489d14a6 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..90b9c8a38765 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..02062c456067 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..d8ce144288e0 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..68ebddbe3e7b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..e34c196ae0d7 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..83dd59d32d25 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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..139261f06ecb 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..1889dce2fa05 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..986d1aa838bd 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..3444a624e64f 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..64d81f796a1b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..ed1191720452 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..72d0295caec5 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..fa8f61fff5ac --- /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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" + 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 = "2021-01-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])?$'), + '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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" + 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..24dfaf311dca 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..fdd9a94bcaf8 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..3b9ebfa99429 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..fb9c887fe98c 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..7736a906f313 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..4b6b78615744 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..b092f694cce1 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..166f9321c4c3 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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..f6a6cba5816d 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..d58259c11af4 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..5e0ddc16315a 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..cbf596a9d822 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..f967156be90e 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..c6eece8cdabb 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 = "2021-01-01-preview" 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..233c731e1456 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 = "2021-01-01-preview" 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..aa0a236f2748 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..a1e997ac7414 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..a81c8c601ef2 --- /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 = "2021-01-01-preview" + 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..e1db92ebef23 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..9578886a99a0 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..075d56d67f05 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..6d3399a25f2d 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..c12217c58daf 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 = "2021-01-01-preview" 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..340d8b18a559 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..60bb94147b1e 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..ac5240ae4f71 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 = "2021-01-01-preview" 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..2b7abb3fdf8b 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..da504d9c7a33 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..38305e6d34c3 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..4619d246a362 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..a8f779b18855 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..6309835b9bbd 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 = "2021-01-01-preview" 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..f146c9321b97 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..c9e7d88ddbfe 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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" + 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..0a9eb3966399 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..d82ac3482fc3 --- /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 = "2021-01-01-preview" + 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 = "2021-01-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'), + '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..608baf50af45 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 = "2021-01-01-preview" 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..2ae06b3521b8 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 = "2021-01-01-preview" 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..1236ab76f55a 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 = "2021-01-01-preview" 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..0a6b7a83c774 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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 = "2021-01-01-preview" 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..775cc497a1fe 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 = "2021-01-01-preview" 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 = "2021-01-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])?$'), + '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