From 11b63548dd14b9e7d13380aea103199916c91e10 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 13 Mar 2021 01:24:43 +0000 Subject: [PATCH] CodeGen from PR 13412 in Azure/azure-rest-api-specs Merge c572b8efc12db6fb1899e3233aada45655e440b4 into b81a30cfeca9873872374279e8351923326cdb04 --- .../apimanagement/_api_management_client.py | 42 +- .../mgmt/apimanagement/models/__init__.py | 124 +- .../models/_api_management_client_enums.py | 85 +- .../mgmt/apimanagement/models/_models.py | 1461 ++++++++++++++-- .../mgmt/apimanagement/models/_models_py3.py | 1529 +++++++++++++++-- .../apimanagement/models/_paged_models.py | 104 ++ .../mgmt/apimanagement/operations/__init__.py | 16 + .../operations/_api_diagnostic_operations.py | 31 +- .../operations/_api_export_operations.py | 4 +- .../_api_issue_attachment_operations.py | 12 +- .../_api_issue_comment_operations.py | 12 +- .../operations/_api_issue_operations.py | 35 +- .../operations/_api_management_operations.py | 12 +- .../_api_management_service_operations.py | 71 +- ..._api_management_service_skus_operations.py | 4 +- .../_api_management_skus_operations.py | 105 ++ .../operations/_api_operation_operations.py | 39 +- .../_api_operation_policy_operations.py | 4 +- .../operations/_api_operations.py | 70 +- .../operations/_api_policy_operations.py | 4 +- .../operations/_api_product_operations.py | 10 +- .../operations/_api_release_operations.py | 31 +- .../operations/_api_revision_operations.py | 10 +- .../operations/_api_schema_operations.py | 10 +- .../_api_tag_description_operations.py | 12 +- .../operations/_api_version_set_operations.py | 29 +- .../_authorization_server_operations.py | 46 +- .../operations/_backend_operations.py | 37 +- .../operations/_cache_operations.py | 25 +- .../operations/_certificate_operations.py | 105 +- .../operations/_content_item_operations.py | 389 +++++ .../operations/_content_type_operations.py | 316 ++++ .../_delegation_settings_operations.py | 4 +- .../_deleted_services_operations.py | 259 +++ .../operations/_diagnostic_operations.py | 31 +- .../operations/_email_template_operations.py | 43 +- .../operations/_gateway_api_operations.py | 14 +- ...ateway_certificate_authority_operations.py | 429 +++++ ...teway_hostname_configuration_operations.py | 32 +- .../operations/_gateway_operations.py | 38 +- .../operations/_group_operations.py | 35 +- .../operations/_group_user_operations.py | 21 +- .../_identity_provider_operations.py | 30 +- .../operations/_issue_operations.py | 22 +- .../operations/_logger_operations.py | 43 +- .../operations/_named_value_operations.py | 153 +- .../operations/_network_status_operations.py | 4 +- .../operations/_notification_operations.py | 4 +- ...notification_recipient_email_operations.py | 4 +- ..._notification_recipient_user_operations.py | 4 +- .../_open_id_connect_provider_operations.py | 41 +- .../operations/_operation_operations.py | 32 +- .../_policy_description_operations.py | 4 +- .../operations/_policy_operations.py | 4 +- .../operations/_portal_revision_operations.py | 502 ++++++ .../operations/_portal_settings_operations.py | 100 ++ .../operations/_product_api_operations.py | 20 +- .../operations/_product_group_operations.py | 14 +- .../operations/_product_operations.py | 53 +- .../operations/_product_policy_operations.py | 4 +- .../_product_subscriptions_operations.py | 28 +- .../_quota_by_counter_keys_operations.py | 24 +- .../_quota_by_period_keys_operations.py | 24 +- .../operations/_region_operations.py | 4 +- .../operations/_reports_operations.py | 61 +- .../_sign_in_settings_operations.py | 4 +- .../_sign_up_settings_operations.py | 4 +- .../operations/_subscription_operations.py | 72 +- .../operations/_tag_operations.py | 57 +- .../operations/_tag_resource_operations.py | 35 +- .../_tenant_access_git_operations.py | 154 +- .../operations/_tenant_access_operations.py | 241 ++- .../_tenant_configuration_operations.py | 12 +- .../operations/_tenant_settings_operations.py | 182 ++ .../_user_confirmation_password_operations.py | 12 +- .../operations/_user_group_operations.py | 16 +- .../operations/_user_identities_operations.py | 4 +- .../operations/_user_operations.py | 59 +- .../_user_subscription_operations.py | 103 +- 79 files changed, 6820 insertions(+), 1004 deletions(-) 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/_content_item_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py create mode 100644 sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_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_revision_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 b7ddabddd99a..99e937f2e2e9 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 @@ -33,6 +33,9 @@ from .operations import BackendOperations from .operations import CacheOperations from .operations import CertificateOperations +from .operations import ContentTypeOperations +from .operations import ContentItemOperations +from .operations import DeletedServicesOperations from .operations import ApiManagementOperations from .operations import ApiManagementServiceSkusOperations from .operations import ApiManagementServiceOperations @@ -41,6 +44,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 @@ -54,6 +58,8 @@ from .operations import OpenIdConnectProviderOperations 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 @@ -66,6 +72,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 @@ -126,6 +134,12 @@ class ApiManagementClient(SDKClient): :vartype cache: azure.mgmt.apimanagement.operations.CacheOperations :ivar certificate: Certificate operations :vartype certificate: azure.mgmt.apimanagement.operations.CertificateOperations + :ivar content_type: ContentType operations + :vartype content_type: azure.mgmt.apimanagement.operations.ContentTypeOperations + :ivar content_item: ContentItem operations + :vartype content_item: azure.mgmt.apimanagement.operations.ContentItemOperations + :ivar deleted_services: DeletedServices operations + :vartype deleted_services: azure.mgmt.apimanagement.operations.DeletedServicesOperations :ivar api_management_operations: ApiManagementOperations operations :vartype api_management_operations: azure.mgmt.apimanagement.operations.ApiManagementOperations :ivar api_management_service_skus: ApiManagementServiceSkus operations @@ -142,6 +156,8 @@ class ApiManagementClient(SDKClient): :vartype gateway_hostname_configuration: azure.mgmt.apimanagement.operations.GatewayHostnameConfigurationOperations :ivar gateway_api: GatewayApi operations :vartype gateway_api: azure.mgmt.apimanagement.operations.GatewayApiOperations + :ivar gateway_certificate_authority: GatewayCertificateAuthority operations + :vartype gateway_certificate_authority: azure.mgmt.apimanagement.operations.GatewayCertificateAuthorityOperations :ivar group: Group operations :vartype group: azure.mgmt.apimanagement.operations.GroupOperations :ivar group_user: GroupUser operations @@ -168,6 +184,10 @@ class ApiManagementClient(SDKClient): :vartype policy: azure.mgmt.apimanagement.operations.PolicyOperations :ivar policy_description: PolicyDescription operations :vartype policy_description: azure.mgmt.apimanagement.operations.PolicyDescriptionOperations + :ivar portal_revision: PortalRevision operations + :vartype portal_revision: azure.mgmt.apimanagement.operations.PortalRevisionOperations + :ivar portal_settings: PortalSettings operations + :vartype portal_settings: azure.mgmt.apimanagement.operations.PortalSettingsOperations :ivar sign_in_settings: SignInSettings operations :vartype sign_in_settings: azure.mgmt.apimanagement.operations.SignInSettingsOperations :ivar sign_up_settings: SignUpSettings operations @@ -192,6 +212,10 @@ class ApiManagementClient(SDKClient): :vartype region: azure.mgmt.apimanagement.operations.RegionOperations :ivar reports: Reports operations :vartype reports: azure.mgmt.apimanagement.operations.ReportsOperations + :ivar tenant_settings: TenantSettings operations + :vartype tenant_settings: azure.mgmt.apimanagement.operations.TenantSettingsOperations + :ivar api_management_skus: ApiManagementSkus operations + :vartype api_management_skus: azure.mgmt.apimanagement.operations.ApiManagementSkusOperations :ivar subscription: Subscription operations :vartype subscription: azure.mgmt.apimanagement.operations.SubscriptionOperations :ivar tag_resource: TagResource operations @@ -232,7 +256,7 @@ def __init__( super(ApiManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-12-01' + self.api_version = '2021-01-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -276,6 +300,12 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.certificate = CertificateOperations( self._client, self.config, self._serialize, self._deserialize) + self.content_type = ContentTypeOperations( + self._client, self.config, self._serialize, self._deserialize) + self.content_item = ContentItemOperations( + self._client, self.config, self._serialize, self._deserialize) + self.deleted_services = DeletedServicesOperations( + self._client, self.config, self._serialize, self._deserialize) self.api_management_operations = ApiManagementOperations( self._client, self.config, self._serialize, self._deserialize) self.api_management_service_skus = ApiManagementServiceSkusOperations( @@ -292,6 +322,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( @@ -318,6 +350,10 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.policy_description = PolicyDescriptionOperations( 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( @@ -342,6 +378,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/models/__init__.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/__init__.py index 63f339e9d0f0..c9e3efaa8d69 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 @@ -11,8 +11,11 @@ try: 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 ApiContactInformation from ._models_py3 import ApiContract from ._models_py3 import ApiContractProperties from ._models_py3 import ApiCreateOrUpdateParameter @@ -20,16 +23,26 @@ 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 ApiManagementServiceNameAvailabilityResult from ._models_py3 import ApiManagementServiceResource from ._models_py3 import ApiManagementServiceSkuProperties from ._models_py3 import ApiManagementServiceUpdateParameters + 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 ApimResource from ._models_py3 import ApiReleaseContract from ._models_py3 import ApiRevisionContract @@ -45,6 +58,7 @@ from ._models_py3 import AuthenticationSettingsContract from ._models_py3 import AuthorizationServerContract from ._models_py3 import AuthorizationServerContractBaseProperties + from ._models_py3 import AuthorizationServerSecretsContract from ._models_py3 import AuthorizationServerUpdateContract from ._models_py3 import BackendAuthorizationHeaderCredentials from ._models_py3 import BackendBaseParameters @@ -65,6 +79,11 @@ from ._models_py3 import CertificateInformation from ._models_py3 import ClientSecretContract from ._models_py3 import ConnectivityStatusContract + from ._models_py3 import ContentItemContract + from ._models_py3 import ContentTypeContract + from ._models_py3 import DataMasking + from ._models_py3 import DataMaskingEntity + from ._models_py3 import DeletedServiceContract from ._models_py3 import DeployConfigurationParameters from ._models_py3 import DiagnosticContract from ._models_py3 import EmailTemplateContract @@ -73,6 +92,7 @@ from ._models_py3 import ErrorFieldContract from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import ErrorResponseBody + from ._models_py3 import GatewayCertificateAuthorityContract from ._models_py3 import GatewayContract from ._models_py3 import GatewayHostnameConfigurationContract from ._models_py3 import GatewayKeyRegenerationRequestContract @@ -95,11 +115,15 @@ from ._models_py3 import IssueContract from ._models_py3 import IssueContractBaseProperties from ._models_py3 import IssueUpdateContract + from ._models_py3 import KeyVaultContractCreateProperties + from ._models_py3 import KeyVaultContractProperties + from ._models_py3 import KeyVaultLastAccessStatusContractProperties from ._models_py3 import LoggerContract from ._models_py3 import LoggerUpdateContract from ._models_py3 import NamedValueContract from ._models_py3 import NamedValueCreateContract from ._models_py3 import NamedValueEntityBaseParameters + from ._models_py3 import NamedValueSecretContract from ._models_py3 import NamedValueUpdateParameters from ._models_py3 import NetworkStatusContract from ._models_py3 import NetworkStatusContractByLocation @@ -123,6 +147,9 @@ from ._models_py3 import PolicyDescriptionCollection from ._models_py3 import PolicyDescriptionContract from ._models_py3 import PortalDelegationSettings + from ._models_py3 import PortalRevisionContract + from ._models_py3 import PortalSettingsCollection + from ._models_py3 import PortalSettingsContract from ._models_py3 import PortalSettingValidationKeyContract from ._models_py3 import PortalSigninSettings from ._models_py3 import PortalSignupSettings @@ -130,11 +157,11 @@ from ._models_py3 import ProductEntityBaseParameters from ._models_py3 import ProductTagResourceContractProperties from ._models_py3 import ProductUpdateParameters - from ._models_py3 import PropertyValueContract from ._models_py3 import QuotaCounterCollection from ._models_py3 import QuotaCounterContract from ._models_py3 import QuotaCounterValueContract from ._models_py3 import QuotaCounterValueContractProperties + from ._models_py3 import QuotaCounterValueUpdateContract from ._models_py3 import RecipientEmailCollection from ._models_py3 import RecipientEmailContract from ._models_py3 import RecipientsContractProperties @@ -168,6 +195,7 @@ from ._models_py3 import TagResourceContract from ._models_py3 import TagTagResourceContractProperties from ._models_py3 import TenantConfigurationSyncStateContract + from ._models_py3 import TenantSettingsContract from ._models_py3 import TermsOfServiceProperties from ._models_py3 import TokenBodyParameterContract from ._models_py3 import UserContract @@ -182,8 +210,11 @@ from ._models_py3 import X509CertificateName except (SyntaxError, ImportError): from ._models import AccessInformationContract + from ._models import AccessInformationCreateParameters + from ._models import AccessInformationSecretsContract from ._models import AccessInformationUpdateParameters from ._models import AdditionalLocation + from ._models import ApiContactInformation from ._models import ApiContract from ._models import ApiContractProperties from ._models import ApiCreateOrUpdateParameter @@ -191,16 +222,26 @@ from ._models import ApiEntityBaseContract from ._models import ApiExportResult from ._models import ApiExportResultValue + from ._models import ApiLicenseInformation from ._models import ApiManagementServiceApplyNetworkConfigurationParameters from ._models import ApiManagementServiceBackupRestoreParameters from ._models import ApiManagementServiceBaseProperties from ._models import ApiManagementServiceCheckNameAvailabilityParameters + from ._models import ApiManagementServiceGetDomainOwnershipIdentifierResult from ._models import ApiManagementServiceGetSsoTokenResult from ._models import ApiManagementServiceIdentity from ._models import ApiManagementServiceNameAvailabilityResult from ._models import ApiManagementServiceResource from ._models import ApiManagementServiceSkuProperties from ._models import ApiManagementServiceUpdateParameters + from ._models import ApiManagementSku + from ._models import ApiManagementSkuCapabilities + from ._models import ApiManagementSkuCapacity + from ._models import ApiManagementSkuCosts + from ._models import ApiManagementSkuLocationInfo + from ._models import ApiManagementSkuRestrictionInfo + from ._models import ApiManagementSkuRestrictions + from ._models import ApiManagementSkuZoneDetails from ._models import ApimResource from ._models import ApiReleaseContract from ._models import ApiRevisionContract @@ -216,6 +257,7 @@ from ._models import AuthenticationSettingsContract from ._models import AuthorizationServerContract from ._models import AuthorizationServerContractBaseProperties + from ._models import AuthorizationServerSecretsContract from ._models import AuthorizationServerUpdateContract from ._models import BackendAuthorizationHeaderCredentials from ._models import BackendBaseParameters @@ -236,6 +278,11 @@ from ._models import CertificateInformation from ._models import ClientSecretContract from ._models import ConnectivityStatusContract + from ._models import ContentItemContract + from ._models import ContentTypeContract + from ._models import DataMasking + from ._models import DataMaskingEntity + from ._models import DeletedServiceContract from ._models import DeployConfigurationParameters from ._models import DiagnosticContract from ._models import EmailTemplateContract @@ -244,6 +291,7 @@ from ._models import ErrorFieldContract from ._models import ErrorResponse, ErrorResponseException from ._models import ErrorResponseBody + from ._models import GatewayCertificateAuthorityContract from ._models import GatewayContract from ._models import GatewayHostnameConfigurationContract from ._models import GatewayKeyRegenerationRequestContract @@ -266,11 +314,15 @@ from ._models import IssueContract from ._models import IssueContractBaseProperties from ._models import IssueUpdateContract + from ._models import KeyVaultContractCreateProperties + from ._models import KeyVaultContractProperties + from ._models import KeyVaultLastAccessStatusContractProperties from ._models import LoggerContract from ._models import LoggerUpdateContract from ._models import NamedValueContract from ._models import NamedValueCreateContract from ._models import NamedValueEntityBaseParameters + from ._models import NamedValueSecretContract from ._models import NamedValueUpdateParameters from ._models import NetworkStatusContract from ._models import NetworkStatusContractByLocation @@ -294,6 +346,9 @@ from ._models import PolicyDescriptionCollection from ._models import PolicyDescriptionContract from ._models import PortalDelegationSettings + from ._models import PortalRevisionContract + from ._models import PortalSettingsCollection + from ._models import PortalSettingsContract from ._models import PortalSettingValidationKeyContract from ._models import PortalSigninSettings from ._models import PortalSignupSettings @@ -301,11 +356,11 @@ from ._models import ProductEntityBaseParameters from ._models import ProductTagResourceContractProperties from ._models import ProductUpdateParameters - from ._models import PropertyValueContract from ._models import QuotaCounterCollection from ._models import QuotaCounterContract from ._models import QuotaCounterValueContract from ._models import QuotaCounterValueContractProperties + from ._models import QuotaCounterValueUpdateContract from ._models import RecipientEmailCollection from ._models import RecipientEmailContract from ._models import RecipientsContractProperties @@ -339,6 +394,7 @@ from ._models import TagResourceContract from ._models import TagTagResourceContractProperties from ._models import TenantConfigurationSyncStateContract + from ._models import TenantSettingsContract from ._models import TermsOfServiceProperties from ._models import TokenBodyParameterContract from ._models import UserContract @@ -351,8 +407,10 @@ from ._models import UserUpdateParameters from ._models import VirtualNetworkConfiguration from ._models import X509CertificateName +from ._paged_models import AccessInformationContractPaged from ._paged_models import ApiContractPaged from ._paged_models import ApiManagementServiceResourcePaged +from ._paged_models import ApiManagementSkuPaged from ._paged_models import ApiReleaseContractPaged from ._paged_models import ApiRevisionContractPaged from ._paged_models import ApiVersionSetContractPaged @@ -360,8 +418,12 @@ from ._paged_models import BackendContractPaged from ._paged_models import CacheContractPaged from ._paged_models import CertificateContractPaged +from ._paged_models import ContentItemContractPaged +from ._paged_models import ContentTypeContractPaged +from ._paged_models import DeletedServiceContractPaged from ._paged_models import DiagnosticContractPaged from ._paged_models import EmailTemplateContractPaged +from ._paged_models import GatewayCertificateAuthorityContractPaged from ._paged_models import GatewayContractPaged from ._paged_models import GatewayHostnameConfigurationContractPaged from ._paged_models import GroupContractPaged @@ -375,6 +437,7 @@ from ._paged_models import OpenidConnectProviderContractPaged from ._paged_models import OperationContractPaged from ._paged_models import OperationPaged +from ._paged_models import PortalRevisionContractPaged from ._paged_models import ProductContractPaged from ._paged_models import RegionContractPaged from ._paged_models import ReportRecordContractPaged @@ -385,6 +448,7 @@ from ._paged_models import TagContractPaged from ._paged_models import TagDescriptionContractPaged from ._paged_models import TagResourceContractPaged +from ._paged_models import TenantSettingsContractPaged from ._paged_models import UserContractPaged from ._paged_models import UserIdentityContractPaged from ._api_management_client_enums import ( @@ -396,10 +460,12 @@ SoapApiType, ApiType, State, + DataMaskingMode, SamplingType, AlwaysLog, HttpCorrelationProtocol, Verbosity, + OperationNameFormat, PolicyContentFormat, VersioningScheme, GrantType, @@ -410,6 +476,8 @@ SkuType, ResourceSkuCapacityScaleType, HostnameType, + CertificateSource, + CertificateStatus, VirtualNetworkType, ApimIdentityType, NameAvailabilityReason, @@ -422,8 +490,13 @@ IdentityProviderType, LoggerType, ConnectivityStatusType, + PortalRevisionStatus, SubscriptionState, + ApiManagementSkuCapacityScaleType, + ApiManagementSkuRestrictionsType, + ApiManagementSkuRestrictionsReasonCode, AsyncOperationStatus, + AccessIdName, NotificationName, PolicyExportFormat, TemplateName, @@ -433,8 +506,11 @@ __all__ = [ 'AccessInformationContract', + 'AccessInformationCreateParameters', + 'AccessInformationSecretsContract', 'AccessInformationUpdateParameters', 'AdditionalLocation', + 'ApiContactInformation', 'ApiContract', 'ApiContractProperties', 'ApiCreateOrUpdateParameter', @@ -442,16 +518,26 @@ 'ApiEntityBaseContract', 'ApiExportResult', 'ApiExportResultValue', + 'ApiLicenseInformation', 'ApiManagementServiceApplyNetworkConfigurationParameters', 'ApiManagementServiceBackupRestoreParameters', 'ApiManagementServiceBaseProperties', 'ApiManagementServiceCheckNameAvailabilityParameters', + 'ApiManagementServiceGetDomainOwnershipIdentifierResult', 'ApiManagementServiceGetSsoTokenResult', 'ApiManagementServiceIdentity', 'ApiManagementServiceNameAvailabilityResult', 'ApiManagementServiceResource', 'ApiManagementServiceSkuProperties', 'ApiManagementServiceUpdateParameters', + 'ApiManagementSku', + 'ApiManagementSkuCapabilities', + 'ApiManagementSkuCapacity', + 'ApiManagementSkuCosts', + 'ApiManagementSkuLocationInfo', + 'ApiManagementSkuRestrictionInfo', + 'ApiManagementSkuRestrictions', + 'ApiManagementSkuZoneDetails', 'ApimResource', 'ApiReleaseContract', 'ApiRevisionContract', @@ -467,6 +553,7 @@ 'AuthenticationSettingsContract', 'AuthorizationServerContract', 'AuthorizationServerContractBaseProperties', + 'AuthorizationServerSecretsContract', 'AuthorizationServerUpdateContract', 'BackendAuthorizationHeaderCredentials', 'BackendBaseParameters', @@ -487,6 +574,11 @@ 'CertificateInformation', 'ClientSecretContract', 'ConnectivityStatusContract', + 'ContentItemContract', + 'ContentTypeContract', + 'DataMasking', + 'DataMaskingEntity', + 'DeletedServiceContract', 'DeployConfigurationParameters', 'DiagnosticContract', 'EmailTemplateContract', @@ -495,6 +587,7 @@ 'ErrorFieldContract', 'ErrorResponse', 'ErrorResponseException', 'ErrorResponseBody', + 'GatewayCertificateAuthorityContract', 'GatewayContract', 'GatewayHostnameConfigurationContract', 'GatewayKeyRegenerationRequestContract', @@ -517,11 +610,15 @@ 'IssueContract', 'IssueContractBaseProperties', 'IssueUpdateContract', + 'KeyVaultContractCreateProperties', + 'KeyVaultContractProperties', + 'KeyVaultLastAccessStatusContractProperties', 'LoggerContract', 'LoggerUpdateContract', 'NamedValueContract', 'NamedValueCreateContract', 'NamedValueEntityBaseParameters', + 'NamedValueSecretContract', 'NamedValueUpdateParameters', 'NetworkStatusContract', 'NetworkStatusContractByLocation', @@ -545,6 +642,9 @@ 'PolicyDescriptionCollection', 'PolicyDescriptionContract', 'PortalDelegationSettings', + 'PortalRevisionContract', + 'PortalSettingsCollection', + 'PortalSettingsContract', 'PortalSettingValidationKeyContract', 'PortalSigninSettings', 'PortalSignupSettings', @@ -552,11 +652,11 @@ 'ProductEntityBaseParameters', 'ProductTagResourceContractProperties', 'ProductUpdateParameters', - 'PropertyValueContract', 'QuotaCounterCollection', 'QuotaCounterContract', 'QuotaCounterValueContract', 'QuotaCounterValueContractProperties', + 'QuotaCounterValueUpdateContract', 'RecipientEmailCollection', 'RecipientEmailContract', 'RecipientsContractProperties', @@ -590,6 +690,7 @@ 'TagResourceContract', 'TagTagResourceContractProperties', 'TenantConfigurationSyncStateContract', + 'TenantSettingsContract', 'TermsOfServiceProperties', 'TokenBodyParameterContract', 'UserContract', @@ -620,12 +721,16 @@ 'BackendContractPaged', 'CacheContractPaged', 'CertificateContractPaged', + 'ContentTypeContractPaged', + 'ContentItemContractPaged', + 'DeletedServiceContractPaged', 'OperationPaged', 'ResourceSkuResultPaged', 'ApiManagementServiceResourcePaged', 'EmailTemplateContractPaged', 'GatewayContractPaged', 'GatewayHostnameConfigurationContractPaged', + 'GatewayCertificateAuthorityContractPaged', 'GroupContractPaged', 'UserContractPaged', 'IdentityProviderContractPaged', @@ -633,10 +738,14 @@ 'NamedValueContractPaged', 'NotificationContractPaged', 'OpenidConnectProviderContractPaged', + 'PortalRevisionContractPaged', 'SubscriptionContractPaged', 'RegionContractPaged', 'ReportRecordContractPaged', 'RequestReportRecordContractPaged', + 'TenantSettingsContractPaged', + 'ApiManagementSkuPaged', + 'AccessInformationContractPaged', 'UserIdentityContractPaged', 'ExportResultFormat', 'ProductState', @@ -646,10 +755,12 @@ 'SoapApiType', 'ApiType', 'State', + 'DataMaskingMode', 'SamplingType', 'AlwaysLog', 'HttpCorrelationProtocol', 'Verbosity', + 'OperationNameFormat', 'PolicyContentFormat', 'VersioningScheme', 'GrantType', @@ -660,6 +771,8 @@ 'SkuType', 'ResourceSkuCapacityScaleType', 'HostnameType', + 'CertificateSource', + 'CertificateStatus', 'VirtualNetworkType', 'ApimIdentityType', 'NameAvailabilityReason', @@ -672,8 +785,13 @@ 'IdentityProviderType', 'LoggerType', 'ConnectivityStatusType', + 'PortalRevisionStatus', 'SubscriptionState', + 'ApiManagementSkuCapacityScaleType', + 'ApiManagementSkuRestrictionsType', + 'ApiManagementSkuRestrictionsReasonCode', 'AsyncOperationStatus', + 'AccessIdName', 'NotificationName', 'PolicyExportFormat', 'TemplateName', 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 6c2944f5bc97..237f36fbfdae 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 @@ -36,32 +36,36 @@ class Protocol(str, Enum): http = "http" https = "https" + ws = "ws" + wss = "wss" class ContentFormat(str, Enum): wadl_xml = "wadl-xml" #: The contents are inline and Content type is a WADL document. wadl_link_json = "wadl-link-json" #: The WADL document is hosted on a publicly accessible internet address. - swagger_json = "swagger-json" #: The contents are inline and Content Type is a OpenApi 2.0 Document. - swagger_link_json = "swagger-link-json" #: The Open Api 2.0 document is hosted on a publicly accessible internet address. + swagger_json = "swagger-json" #: The contents are inline and Content Type is a OpenAPI 2.0 JSON Document. + swagger_link_json = "swagger-link-json" #: The OpenAPI 2.0 JSON document is hosted on a publicly accessible internet address. wsdl = "wsdl" #: The contents are inline and the document is a WSDL/Soap document. wsdl_link = "wsdl-link" #: The WSDL document is hosted on a publicly accessible internet address. - openapi = "openapi" #: The contents are inline and Content Type is a OpenApi 3.0 Document in YAML format. - openapijson = "openapi+json" #: The contents are inline and Content Type is a OpenApi 3.0 Document in JSON format. - openapi_link = "openapi-link" #: The Open Api 3.0 document is hosted on a publicly accessible internet address. - openapijson_link = "openapi+json-link" #: The Open Api 3.0 Json document is hosted on a publicly accessible internet address. + openapi = "openapi" #: The contents are inline and Content Type is a OpenAPI 3.0 YAML Document. + openapijson = "openapi+json" #: The contents are inline and Content Type is a OpenAPI 3.0 JSON Document. + openapi_link = "openapi-link" #: The OpenAPI 3.0 YAML document is hosted on a publicly accessible internet address. + openapijson_link = "openapi+json-link" #: The OpenAPI 3.0 JSON document is hosted on a publicly accessible internet address. class SoapApiType(str, Enum): 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 ApiType(str, Enum): http = "http" soap = "soap" + websocket = "websocket" class State(str, Enum): @@ -73,6 +77,12 @@ class State(str, Enum): closed = "closed" #: The issue was closed. +class DataMaskingMode(str, Enum): + + mask = "Mask" #: Mask the value of an entity. + hide = "Hide" #: Hide the presence of an entity. + + class SamplingType(str, Enum): fixed = "fixed" #: Fixed-rate sampling. @@ -97,6 +107,12 @@ class Verbosity(str, Enum): error = "error" #: Only traces with 'severity' set to 'error' will be sent to the logger attached to this diagnostic instance. +class OperationNameFormat(str, Enum): + + name = "Name" #: API_NAME;rev=API_REVISION - OPERATION_NAME + url = "Url" #: HTTP_VERB URL + + class PolicyContentFormat(str, Enum): xml = "xml" #: The contents are inline and Content type is an XML document. @@ -157,6 +173,7 @@ class SkuType(str, Enum): premium = "Premium" #: Premium SKU of Api Management. basic = "Basic" #: Basic SKU of Api Management. consumption = "Consumption" #: Consumption SKU of Api Management. + isolated = "Isolated" #: Isolated SKU of Api Management. class ResourceSkuCapacityScaleType(str, Enum): @@ -175,6 +192,21 @@ class HostnameType(str, Enum): developer_portal = "DeveloperPortal" +class CertificateSource(str, Enum): + + managed = "Managed" + key_vault = "KeyVault" + custom = "Custom" + built_in = "BuiltIn" + + +class CertificateStatus(str, Enum): + + completed = "Completed" + failed = "Failed" + in_progress = "InProgress" + + class VirtualNetworkType(str, Enum): none = "None" #: The service is not part of any Virtual Network. @@ -210,6 +242,7 @@ class KeyType(str, Enum): class AppType(str, Enum): + portal = "portal" #: User create request was sent by legacy developer portal. developer_portal = "developerPortal" #: User create request was sent by new developer portal. @@ -248,6 +281,7 @@ class LoggerType(str, Enum): azure_event_hub = "azureEventHub" #: Azure Event Hub as log destination. application_insights = "applicationInsights" #: Azure Application Insights as log destination. + azure_monitor = "azureMonitor" #: Azure Monitor class ConnectivityStatusType(str, Enum): @@ -257,6 +291,14 @@ class ConnectivityStatusType(str, Enum): failure = "failure" +class PortalRevisionStatus(str, Enum): + + pending = "pending" #: Portal revision publishing is pending + publishing = "publishing" #: Portal revision is publishing + completed = "completed" #: Portal revision publishing completed + failed = "failed" #: Portal revision publishing failed + + class SubscriptionState(str, Enum): suspended = "suspended" @@ -267,6 +309,25 @@ class SubscriptionState(str, Enum): cancelled = "cancelled" +class ApiManagementSkuCapacityScaleType(str, Enum): + + automatic = "Automatic" + manual = "Manual" + none = "None" + + +class ApiManagementSkuRestrictionsType(str, Enum): + + location = "Location" + zone = "Zone" + + +class ApiManagementSkuRestrictionsReasonCode(str, Enum): + + quota_id = "QuotaId" + not_available_for_subscription = "NotAvailableForSubscription" + + class AsyncOperationStatus(str, Enum): started = "Started" @@ -275,6 +336,12 @@ class AsyncOperationStatus(str, Enum): failed = "Failed" +class AccessIdName(str, Enum): + + access = "access" + git_access = "gitAccess" + + class NotificationName(str, Enum): request_publisher_notification_message = "RequestPublisherNotificationMessage" #: The following email recipients and users will receive email notifications about subscription requests for API products requiring approval. @@ -321,8 +388,8 @@ class PolicyScopeContract(str, Enum): class ExportFormat(str, Enum): - swagger = "swagger-link" #: Export the Api Definition in OpenApi Specification 2.0 format to the Storage Blob. + swagger = "swagger-link" #: Export the Api Definition in OpenAPI 2.0 Specification as JSON document to the Storage Blob. wsdl = "wsdl-link" #: Export the Api Definition in WSDL Schema to Storage Blob. This is only supported for APIs of Type `soap` wadl = "wadl-link" #: Export the Api Definition in WADL Schema to Storage Blob. - openapi = "openapi-link" #: Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. - openapi_json = "openapi+json-link" #: Export the Api Definition in OpenApi Specification 3.0 as JSON document to Storage Blob. + openapi = "openapi-link" #: Export the Api Definition in OpenAPI 3.0 Specification as YAML document to Storage Blob. + openapi_json = "openapi+json-link" #: Export the Api Definition in OpenAPI 3.0 Specification as JSON document to Storage Blob. 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 3e016257f412..bd7b2912c8de 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 @@ -13,11 +13,120 @@ from msrest.exceptions import HttpOperationError -class AccessInformationContract(Model): +class Resource(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 access_information_contract_id: Access Information type ('access' + or 'gitAccess') + :type access_information_contract_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'}, + 'access_information_contract_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.access_information_contract_id = kwargs.get('access_information_contract_id', None) + self.principal_id = kwargs.get('principal_id', None) + self.enabled = kwargs.get('enabled', None) + + +class AccessInformationCreateParameters(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(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 @@ -31,14 +140,16 @@ class AccessInformationContract(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'}, } 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) @@ -74,15 +185,22 @@ class AdditionalLocation(Model): :param sku: Required. SKU properties of the API Management service. :type sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :param zones: A list of availability zones denoting where the resource + needs to come from. + :type zones: list[str] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for - Basic, Standard and Premium SKU. + 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 which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, - Standard and Premium SKU. + 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: @@ -107,8 +225,10 @@ class AdditionalLocation(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + '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'}, @@ -118,44 +238,39 @@ def __init__(self, **kwargs): super(AdditionalLocation, self).__init__(**kwargs) self.location = kwargs.get('location', None) self.sku = kwargs.get('sku', None) + 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) -class Resource(Model): - """The Resource definition. +class ApiContactInformation(Model): + """API contact information. - 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 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): @@ -183,7 +298,8 @@ class ApiContract(Resource): 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 @@ -205,6 +321,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. @@ -255,11 +378,14 @@ 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'}, 'path': {'key': 'properties.path', 'type': 'str'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'properties.protocols', 'type': '[str]'}, 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, } @@ -277,6 +403,9 @@ def __init__(self, **kwargs): 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) @@ -302,7 +431,8 @@ class ApiEntityBaseContract(Model): 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 @@ -324,6 +454,13 @@ class ApiEntityBaseContract(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 = { @@ -347,6 +484,9 @@ class ApiEntityBaseContract(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__(self, **kwargs): @@ -363,6 +503,9 @@ def __init__(self, **kwargs): 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): @@ -384,7 +527,8 @@ class ApiContractProperties(ApiEntityBaseContract): 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 @@ -406,6 +550,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. @@ -450,11 +601,14 @@ 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'}, 'path': {'key': 'path', 'type': 'str'}, - 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, 'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, } @@ -487,7 +641,8 @@ class ApiCreateOrUpdateParameter(Model): 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 @@ -509,6 +664,13 @@ class ApiCreateOrUpdateParameter(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. @@ -539,9 +701,10 @@ class ApiCreateOrUpdateParameter(Model): :type wsdl_selector: ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector :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: - 'SoapToRest', 'SoapPassThrough' + * `http` creates a REST API + * `soap` creates a SOAP pass-through API + * `websocket` creates websocket API. Possible values include: + 'SoapToRest', 'SoapPassThrough', 'WebSocket' :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ @@ -569,11 +732,14 @@ class ApiCreateOrUpdateParameter(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'}, 'path': {'key': 'properties.path', 'type': 'str'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'properties.protocols', 'type': '[str]'}, 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, 'value': {'key': 'properties.value', 'type': 'str'}, 'format': {'key': 'properties.format', 'type': 'str'}, @@ -595,6 +761,9 @@ def __init__(self, **kwargs): 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) @@ -671,6 +840,27 @@ def __init__(self, **kwargs): self.link = kwargs.get('link', None) +class ApiLicenseInformation(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(Model): """Parameter supplied to the Apply Network configuration operation. @@ -773,13 +963,18 @@ class ApiManagementServiceBaseProperties(Model): 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 and Premium SKU. + 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 and Premium - SKU. + 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: @@ -851,6 +1046,10 @@ class ApiManagementServiceBaseProperties(Model): 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. Default value: False . + :type restore: bool """ _validation = { @@ -882,6 +1081,7 @@ class ApiManagementServiceBaseProperties(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}'}, @@ -890,6 +1090,7 @@ class ApiManagementServiceBaseProperties(Model): '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'}, } def __init__(self, **kwargs): @@ -907,6 +1108,7 @@ def __init__(self, **kwargs): 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) @@ -915,6 +1117,7 @@ def __init__(self, **kwargs): self.disable_gateway = kwargs.get('disable_gateway', False) self.virtual_network_type = kwargs.get('virtual_network_type', "None") self.api_version_constraint = kwargs.get('api_version_constraint', None) + self.restore = kwargs.get('restore', False) class ApiManagementServiceCheckNameAvailabilityParameters(Model): @@ -939,6 +1142,29 @@ def __init__(self, **kwargs): self.name = kwargs.get('name', None) +class ApiManagementServiceGetDomainOwnershipIdentifierResult(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(Model): """The response of the GetSsoToken operation. @@ -1138,13 +1364,18 @@ class ApiManagementServiceResource(ApimResource): 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 and Premium SKU. + 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 and Premium - SKU. + 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: @@ -1216,6 +1447,10 @@ class ApiManagementServiceResource(ApimResource): 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. Default value: False . + :type restore: bool :param publisher_email: Required. Publisher email. :type publisher_email: str :param publisher_name: Required. Publisher name. @@ -1230,6 +1465,9 @@ class ApiManagementServiceResource(ApimResource): :type location: str :ivar etag: ETag of the resource. :vartype etag: str + :param zones: A list of availability zones denoting where the resource + needs to come from. + :type zones: list[str] """ _validation = { @@ -1273,6 +1511,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}'}, @@ -1281,12 +1520,14 @@ class ApiManagementServiceResource(ApimResource): 'disable_gateway': {'key': 'properties.disableGateway', 'type': 'bool'}, 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, 'api_version_constraint': {'key': 'properties.apiVersionConstraint', 'type': 'ApiVersionConstraint'}, + 'restore': {'key': 'properties.restore', 'type': 'bool'}, 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, 'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'}, 'location': {'key': 'location', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, } def __init__(self, **kwargs): @@ -1304,6 +1545,7 @@ def __init__(self, **kwargs): 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) @@ -1312,12 +1554,14 @@ def __init__(self, **kwargs): self.disable_gateway = kwargs.get('disable_gateway', False) self.virtual_network_type = kwargs.get('virtual_network_type', "None") self.api_version_constraint = kwargs.get('api_version_constraint', None) + self.restore = kwargs.get('restore', False) self.publisher_email = kwargs.get('publisher_email', None) self.publisher_name = kwargs.get('publisher_name', None) self.sku = kwargs.get('sku', None) self.identity = kwargs.get('identity', None) self.location = kwargs.get('location', None) self.etag = None + self.zones = kwargs.get('zones', None) class ApiManagementServiceSkuProperties(Model): @@ -1326,7 +1570,7 @@ class ApiManagementServiceSkuProperties(Model): All required parameters must be populated in order to send to Azure. :param name: Required. Name of the Sku. Possible values include: - 'Developer', 'Standard', 'Premium', 'Basic', 'Consumption' + 'Developer', 'Standard', 'Premium', 'Basic', 'Consumption', 'Isolated' :type name: str or ~azure.mgmt.apimanagement.models.SkuType :param capacity: Required. Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. @@ -1401,13 +1645,18 @@ class ApiManagementServiceUpdateParameters(ApimResource): 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 and Premium SKU. + 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 and Premium - SKU. + 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: @@ -1479,6 +1728,10 @@ class ApiManagementServiceUpdateParameters(ApimResource): 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. Default value: False . + :type restore: bool :param publisher_email: Publisher email. :type publisher_email: str :param publisher_name: Publisher name. @@ -1532,6 +1785,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}'}, @@ -1540,6 +1794,7 @@ class ApiManagementServiceUpdateParameters(ApimResource): 'disable_gateway': {'key': 'properties.disableGateway', 'type': 'bool'}, 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, 'api_version_constraint': {'key': 'properties.apiVersionConstraint', 'type': 'ApiVersionConstraint'}, + 'restore': {'key': 'properties.restore', 'type': 'bool'}, 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, @@ -1562,6 +1817,7 @@ def __init__(self, **kwargs): 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) @@ -1570,6 +1826,7 @@ def __init__(self, **kwargs): self.disable_gateway = kwargs.get('disable_gateway', False) self.virtual_network_type = kwargs.get('virtual_network_type', "None") self.api_version_constraint = kwargs.get('api_version_constraint', None) + self.restore = kwargs.get('restore', False) self.publisher_email = kwargs.get('publisher_email', None) self.publisher_name = kwargs.get('publisher_name', None) self.sku = kwargs.get('sku', None) @@ -1577,6 +1834,337 @@ def __init__(self, **kwargs): self.etag = None +class ApiManagementSku(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.

Possible Values:

**Standard**

**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(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(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': 'ApiManagementSkuCapacityScaleType'}, + } + + def __init__(self, **kwargs): + super(ApiManagementSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class ApiManagementSkuCosts(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(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(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(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': 'ApiManagementSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ApiManagementSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'ApiManagementSkuRestrictionsReasonCode'}, + } + + def __init__(self, **kwargs): + super(ApiManagementSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ApiManagementSkuZoneDetails(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 ApiReleaseContract(Resource): """ApiRelease details. @@ -1742,7 +2330,8 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): 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 @@ -1764,6 +2353,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. @@ -1805,11 +2401,14 @@ 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'}, 'path': {'key': 'path', 'type': 'str'}, - 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, } def __init__(self, **kwargs): @@ -1838,7 +2437,8 @@ class ApiUpdateContract(Model): 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 @@ -1860,6 +2460,13 @@ class ApiUpdateContract(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 @@ -1899,10 +2506,13 @@ class ApiUpdateContract(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'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'properties.protocols', 'type': '[str]'}, } def __init__(self, **kwargs): @@ -1919,6 +2529,9 @@ def __init__(self, **kwargs): 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) @@ -1967,7 +2580,7 @@ class ApiVersionSetContract(Resource): :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 will be located in a HTTP request. Possible values + 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 @@ -2015,7 +2628,7 @@ class ApiVersionSetContractDetails(Model): :param description: Description of API Version Set. :type description: str :param versioning_scheme: An value that determines where the API Version - identifer will be located in a HTTP request. Possible values include: + identifier will be located in a HTTP request. Possible values include: 'Segment', 'Query', 'Header' :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.enum :param version_query_name: Name of query parameter that indicates the API @@ -2090,7 +2703,7 @@ class ApiVersionSetUpdateParameters(Model): :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 located in a HTTP request. Possible values include: + identifier will be located in a HTTP request. Possible values include: 'Segment', 'Query', 'Header' :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme @@ -2383,6 +2996,34 @@ def __init__(self, **kwargs): self.resource_owner_password = kwargs.get('resource_owner_password', None) +class AuthorizationServerSecretsContract(Model): + """OAuth Server Secrets Contract. + + :param client_secret: oAuth Authorization Server Secrets. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + """ + + _attribute_map = { + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'resourceOwnerPassword', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AuthorizationServerSecretsContract, self).__init__(**kwargs) + self.client_secret = kwargs.get('client_secret', None) + self.resource_owner_username = kwargs.get('resource_owner_username', None) + self.resource_owner_password = kwargs.get('resource_owner_password', None) + + class AuthorizationServerUpdateContract(Resource): """External OAuth authorization server settings. @@ -2664,7 +3305,10 @@ def __init__(self, **kwargs): class BackendCredentialsContract(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]] @@ -2676,10 +3320,12 @@ class BackendCredentialsContract(Model): """ _validation = { + 'certificate_ids': {'max_items': 32}, 'certificate': {'max_items': 32}, } _attribute_map = { + 'certificate_ids': {'key': 'certificateIds', 'type': '[str]'}, 'certificate': {'key': 'certificate', 'type': '[str]'}, 'query': {'key': 'query', 'type': '{[str]}'}, 'header': {'key': 'header', 'type': '{[str]}'}, @@ -2688,6 +3334,7 @@ class BackendCredentialsContract(Model): def __init__(self, **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) @@ -2783,8 +3430,11 @@ class BackendServiceFabricClusterProperties(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. @@ -2800,11 +3450,11 @@ class BackendServiceFabricClusterProperties(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]'}, @@ -2814,6 +3464,7 @@ class BackendServiceFabricClusterProperties(Model): def __init__(self, **kwargs): super(BackendServiceFabricClusterProperties, self).__init__(**kwargs) + 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.get('management_endpoints', None) @@ -2942,6 +3593,9 @@ class CacheContract(Resource): :type description: str :param connection_string: Required. Runtime connection string to cache :type connection_string: str + :param use_from_location: Required. Location identifier to use cache from + (should be either 'default' or valid Azure region identifier) + :type use_from_location: str :param resource_id: Original uri of entity in external system cache points to :type resource_id: str @@ -2953,6 +3607,7 @@ class CacheContract(Resource): 'type': {'readonly': True}, 'description': {'max_length': 2000}, 'connection_string': {'required': True, 'max_length': 300}, + 'use_from_location': {'required': True, 'max_length': 256}, 'resource_id': {'max_length': 2000}, } @@ -2962,6 +3617,7 @@ class CacheContract(Resource): 'type': {'key': 'type', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'use_from_location': {'key': 'properties.useFromLocation', 'type': 'str'}, 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, } @@ -2969,6 +3625,7 @@ def __init__(self, **kwargs): super(CacheContract, self).__init__(**kwargs) self.description = kwargs.get('description', None) self.connection_string = kwargs.get('connection_string', None) + self.use_from_location = kwargs.get('use_from_location', None) self.resource_id = kwargs.get('resource_id', None) @@ -2979,6 +3636,9 @@ class CacheUpdateParameters(Model): :type description: str :param connection_string: Runtime connection string to cache :type connection_string: str + :param use_from_location: Location identifier to use cache from (should be + either 'default' or valid Azure region identifier) + :type use_from_location: str :param resource_id: Original uri of entity in external system cache points to :type resource_id: str @@ -2987,12 +3647,14 @@ class CacheUpdateParameters(Model): _validation = { 'description': {'max_length': 2000}, 'connection_string': {'max_length': 300}, + 'use_from_location': {'max_length': 256}, 'resource_id': {'max_length': 2000}, } _attribute_map = { 'description': {'key': 'properties.description', 'type': 'str'}, 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'use_from_location': {'key': 'properties.useFromLocation', 'type': 'str'}, 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, } @@ -3000,6 +3662,7 @@ def __init__(self, **kwargs): super(CacheUpdateParameters, self).__init__(**kwargs) self.description = kwargs.get('description', None) self.connection_string = kwargs.get('connection_string', None) + self.use_from_location = kwargs.get('use_from_location', None) self.resource_id = kwargs.get('resource_id', None) @@ -3063,6 +3726,9 @@ class CertificateContract(Resource): date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. :type expiration_date: datetime + :param key_vault: KeyVault location details of the certificate. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ _validation = { @@ -3081,6 +3747,7 @@ class CertificateContract(Resource): 'subject': {'key': 'properties.subject', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractProperties'}, } def __init__(self, **kwargs): @@ -3088,34 +3755,33 @@ def __init__(self, **kwargs): self.subject = kwargs.get('subject', None) self.thumbprint = kwargs.get('thumbprint', None) self.expiration_date = kwargs.get('expiration_date', None) + self.key_vault = kwargs.get('key_vault', None) class CertificateCreateOrUpdateParameters(Model): """Certificate create or update details. - All required parameters must be populated in order to send to Azure. - - :param data: Required. Base 64 encoded certificate using the - application/x-pkcs12 representation. + :param data: Base 64 encoded certificate using the application/x-pkcs12 + representation. :type data: str - :param password: Required. Password for the Certificate + :param password: Password for the Certificate :type password: str + :param key_vault: KeyVault location details of the certificate. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ - _validation = { - 'data': {'required': True}, - 'password': {'required': True}, - } - _attribute_map = { 'data': {'key': 'properties.data', 'type': 'str'}, 'password': {'key': 'properties.password', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractCreateProperties'}, } def __init__(self, **kwargs): super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) self.data = kwargs.get('data', None) self.password = kwargs.get('password', None) + self.key_vault = kwargs.get('key_vault', None) class CertificateInformation(Model): @@ -3204,6 +3870,10 @@ class ConnectivityStatusContract(Model): The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. :type last_status_change: datetime + :param resource_type: Required. Resource Type. + :type resource_type: str + :param is_optional: Required. Whether this is optional. + :type is_optional: bool """ _validation = { @@ -3211,6 +3881,8 @@ class ConnectivityStatusContract(Model): 'status': {'required': True}, 'last_updated': {'required': True}, 'last_status_change': {'required': True}, + 'resource_type': {'required': True}, + 'is_optional': {'required': True}, } _attribute_map = { @@ -3219,6 +3891,8 @@ class ConnectivityStatusContract(Model): 'error': {'key': 'error', 'type': 'str'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -3228,6 +3902,186 @@ def __init__(self, **kwargs): self.error = kwargs.get('error', None) self.last_updated = kwargs.get('last_updated', None) self.last_status_change = kwargs.get('last_status_change', None) + self.resource_type = kwargs.get('resource_type', None) + self.is_optional = kwargs.get('is_optional', None) + + +class ContentItemContract(Resource): + """Content type contract 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 properties: Properties of the content item. + :type properties: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(ContentItemContract, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ContentTypeContract(Resource): + """Content type contract 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 content_type_contract_id: Content type identifier + :type content_type_contract_id: str + :param content_type_contract_name: Content type name. Must be 1 to 250 + characters long. + :type content_type_contract_name: str + :param description: Content type description. + :type description: str + :param schema: Content type schema. + :type schema: object + :param version: Content type version. + :type version: 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'}, + 'content_type_contract_id': {'key': 'properties.id', 'type': 'str'}, + 'content_type_contract_name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'schema': {'key': 'properties.schema', 'type': 'object'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ContentTypeContract, self).__init__(**kwargs) + self.content_type_contract_id = kwargs.get('content_type_contract_id', None) + self.content_type_contract_name = kwargs.get('content_type_contract_name', None) + self.description = kwargs.get('description', None) + self.schema = kwargs.get('schema', None) + self.version = kwargs.get('version', None) + + +class DataMasking(Model): + """DataMasking. + + :param query_params: Masking settings for Url query parameters + :type query_params: + list[~azure.mgmt.apimanagement.models.DataMaskingEntity] + :param headers: Masking settings for headers + :type headers: list[~azure.mgmt.apimanagement.models.DataMaskingEntity] + """ + + _attribute_map = { + 'query_params': {'key': 'queryParams', 'type': '[DataMaskingEntity]'}, + 'headers': {'key': 'headers', 'type': '[DataMaskingEntity]'}, + } + + def __init__(self, **kwargs): + super(DataMasking, self).__init__(**kwargs) + self.query_params = kwargs.get('query_params', None) + self.headers = kwargs.get('headers', None) + + +class DataMaskingEntity(Model): + """DataMaskingEntity. + + :param value: The name of an entity to mask (e.g. a name of a header or a + query parameter). + :type value: str + :param mode: Data masking mode. Possible values include: 'Mask', 'Hide' + :type mode: str or ~azure.mgmt.apimanagement.models.DataMaskingMode + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataMaskingEntity, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.mode = kwargs.get('mode', None) + + +class DeletedServiceContract(Resource): + """Deleted Api Management Service information. + + 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 service_id: Fully-qualified API Management Service Resource ID + :type service_id: str + :param scheduled_purge_date: UTC Date and Time when the service will be + automatically purged. The date conforms to the following format: + yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + :type scheduled_purge_date: datetime + :param deletion_date: UTC Timestamp when the service was soft-deleted. The + date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + by the ISO 8601 standard. + :type deletion_date: datetime + :ivar location: Api Management Service Master Location. + :vartype location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_id': {'key': 'properties.serviceId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'iso-8601'}, + 'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DeletedServiceContract, self).__init__(**kwargs) + self.service_id = kwargs.get('service_id', None) + self.scheduled_purge_date = kwargs.get('scheduled_purge_date', None) + self.deletion_date = kwargs.get('deletion_date', None) + self.location = None class DeployConfigurationParameters(Model): @@ -3296,6 +4150,11 @@ class DiagnosticContract(Resource): :param verbosity: The verbosity level applied to traces emitted by trace policies. Possible values include: 'verbose', 'information', 'error' :type verbosity: str or ~azure.mgmt.apimanagement.models.Verbosity + :param operation_name_format: The format of the Operation Name for + Application Insights telemetries. Default is Name. Possible values + include: 'Name', 'Url' + :type operation_name_format: str or + ~azure.mgmt.apimanagement.models.OperationNameFormat """ _validation = { @@ -3317,6 +4176,7 @@ class DiagnosticContract(Resource): 'log_client_ip': {'key': 'properties.logClientIp', 'type': 'bool'}, 'http_correlation_protocol': {'key': 'properties.httpCorrelationProtocol', 'type': 'str'}, 'verbosity': {'key': 'properties.verbosity', 'type': 'str'}, + 'operation_name_format': {'key': 'properties.operationNameFormat', 'type': 'str'}, } def __init__(self, **kwargs): @@ -3329,6 +4189,7 @@ def __init__(self, **kwargs): self.log_client_ip = kwargs.get('log_client_ip', None) self.http_correlation_protocol = kwargs.get('http_correlation_protocol', None) self.verbosity = kwargs.get('verbosity', None) + self.operation_name_format = kwargs.get('operation_name_format', None) class EmailTemplateContract(Resource): @@ -3537,16 +4398,50 @@ class ErrorResponseBody(Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + '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 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, **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 GatewayContract(Resource): @@ -3610,6 +4505,12 @@ class GatewayHostnameConfigurationContract(Resource): :param negotiate_client_certificate: Determines whether gateway requests client certificate :type negotiate_client_certificate: bool + :param tls10_enabled: Specifies if TLS 1.0 is supported + :type tls10_enabled: bool + :param tls11_enabled: Specifies if TLS 1.1 is supported + :type tls11_enabled: bool + :param http2_enabled: Specifies if HTTP/2.0 is supported + :type http2_enabled: bool """ _validation = { @@ -3625,6 +4526,9 @@ class GatewayHostnameConfigurationContract(Resource): 'hostname': {'key': 'properties.hostname', 'type': 'str'}, 'certificate_id': {'key': 'properties.certificateId', 'type': 'str'}, 'negotiate_client_certificate': {'key': 'properties.negotiateClientCertificate', 'type': 'bool'}, + 'tls10_enabled': {'key': 'properties.tls10Enabled', 'type': 'bool'}, + 'tls11_enabled': {'key': 'properties.tls11Enabled', 'type': 'bool'}, + 'http2_enabled': {'key': 'properties.http2Enabled', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -3632,6 +4536,9 @@ def __init__(self, **kwargs): self.hostname = kwargs.get('hostname', None) self.certificate_id = kwargs.get('certificate_id', None) self.negotiate_client_certificate = kwargs.get('negotiate_client_certificate', None) + self.tls10_enabled = kwargs.get('tls10_enabled', None) + self.tls11_enabled = kwargs.get('tls11_enabled', None) + self.http2_enabled = kwargs.get('http2_enabled', None) class GatewayKeyRegenerationRequestContract(Model): @@ -3937,9 +4844,13 @@ class HostnameConfiguration(Model): :param key_vault_id: Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to - be configured with MSI. The secret should be of type + be configured with aka.ms/apimmsi. The secret should be of type *application/x-pkcs12* :type key_vault_id: str + :param identity_client_id: System or User Assigned Managed identity + clientId as generated by Azure AD, which has GET access to the keyVault + containing the SSL certificate. + :type identity_client_id: str :param encoded_certificate: Base64 Encoded certificate. :type encoded_certificate: str :param certificate_password: Certificate Password. @@ -3957,6 +4868,14 @@ class HostnameConfiguration(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 = { @@ -3968,11 +4887,14 @@ class HostnameConfiguration(Model): 'type': {'key': 'type', 'type': 'str'}, 'host_name': {'key': 'hostName', 'type': 'str'}, 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, 'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'}, 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, '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__(self, **kwargs): @@ -3980,11 +4902,14 @@ def __init__(self, **kwargs): self.type = kwargs.get('type', None) self.host_name = kwargs.get('host_name', None) self.key_vault_id = kwargs.get('key_vault_id', None) + self.identity_client_id = kwargs.get('identity_client_id', None) self.encoded_certificate = kwargs.get('encoded_certificate', None) self.certificate_password = kwargs.get('certificate_password', None) 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(Model): @@ -3994,17 +4919,21 @@ class HttpMessageDiagnostic(Model): :type headers: list[str] :param body: Body logging settings. :type body: ~azure.mgmt.apimanagement.models.BodyDiagnosticSettings + :param data_masking: Data masking settings. + :type data_masking: ~azure.mgmt.apimanagement.models.DataMasking """ _attribute_map = { 'headers': {'key': 'headers', 'type': '[str]'}, 'body': {'key': 'body', 'type': 'BodyDiagnosticSettings'}, + 'data_masking': {'key': 'dataMasking', 'type': 'DataMasking'}, } def __init__(self, **kwargs): super(HttpMessageDiagnostic, self).__init__(**kwargs) self.headers = kwargs.get('headers', None) self.body = kwargs.get('body', None) + self.data_masking = kwargs.get('data_masking', None) class IdentityProviderBaseParameters(Model): @@ -4554,6 +5483,83 @@ def __init__(self, **kwargs): self.user_id = kwargs.get('user_id', None) +class KeyVaultContractCreateProperties(Model): + """Create keyVault contract details. + + :param secret_identifier: Key vault secret identifier for fetching secret. + Providing a versioned secret will prevent auto-refresh. This requires Api + Management service to be configured with aka.ms/apimmsi + :type secret_identifier: str + :param identity_client_id: SystemAssignedIdentity or UserAssignedIdentity + Client Id which will be used to access key vault secret. + :type identity_client_id: str + """ + + _attribute_map = { + 'secret_identifier': {'key': 'secretIdentifier', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultContractCreateProperties, self).__init__(**kwargs) + self.secret_identifier = kwargs.get('secret_identifier', None) + self.identity_client_id = kwargs.get('identity_client_id', None) + + +class KeyVaultContractProperties(KeyVaultContractCreateProperties): + """KeyVault contract details. + + :param secret_identifier: Key vault secret identifier for fetching secret. + Providing a versioned secret will prevent auto-refresh. This requires Api + Management service to be configured with aka.ms/apimmsi + :type secret_identifier: str + :param identity_client_id: SystemAssignedIdentity or UserAssignedIdentity + Client Id which will be used to access key vault secret. + :type identity_client_id: str + :param last_status: Last time sync and refresh status of secret from key + vault. + :type last_status: + ~azure.mgmt.apimanagement.models.KeyVaultLastAccessStatusContractProperties + """ + + _attribute_map = { + 'secret_identifier': {'key': 'secretIdentifier', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + 'last_status': {'key': 'lastStatus', 'type': 'KeyVaultLastAccessStatusContractProperties'}, + } + + def __init__(self, **kwargs): + super(KeyVaultContractProperties, self).__init__(**kwargs) + self.last_status = kwargs.get('last_status', None) + + +class KeyVaultLastAccessStatusContractProperties(Model): + """Issue contract Update Properties. + + :param code: Last status code for sync and refresh of secret from key + vault. + :type code: str + :param message: Details of the error else empty. + :type message: str + :param time_stamp_utc: Last time secret was accessed. The date conforms to + the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type time_stamp_utc: datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time_stamp_utc': {'key': 'timeStampUtc', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(KeyVaultLastAccessStatusContractProperties, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.time_stamp_utc = kwargs.get('time_stamp_utc', None) + + class LoggerContract(Resource): """Logger details. @@ -4569,12 +5575,12 @@ class LoggerContract(Resource): :ivar type: Resource type for API Management resource. :vartype type: str :param logger_type: Required. Logger type. Possible values include: - 'azureEventHub', 'applicationInsights' + 'azureEventHub', 'applicationInsights', 'azureMonitor' :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :param description: Logger description. :type description: str - :param credentials: Required. The name and SendRule connection string of - the event hub for azureEventHub logger. + :param credentials: The name and SendRule connection string of the event + hub for azureEventHub logger. Instrumentation key for applicationInsights logger. :type credentials: dict[str, str] :param is_buffered: Whether records are buffered in the logger before @@ -4591,7 +5597,6 @@ class LoggerContract(Resource): 'type': {'readonly': True}, 'logger_type': {'required': True}, 'description': {'max_length': 256}, - 'credentials': {'required': True}, } _attribute_map = { @@ -4618,7 +5623,7 @@ class LoggerUpdateContract(Model): """Logger update contract. :param logger_type: Logger type. Possible values include: 'azureEventHub', - 'applicationInsights' + 'applicationInsights', 'azureMonitor' :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :param description: Logger description. :type description: str @@ -4672,6 +5677,9 @@ class NamedValueContract(Resource): filled on 'GET' operations! Use '/listSecrets' POST request to get the value. :type value: str + :param key_vault: KeyVault location details of the namedValue. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ _validation = { @@ -4680,7 +5688,7 @@ class NamedValueContract(Resource): 'type': {'readonly': True}, 'tags': {'max_items': 32}, 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'max_length': 4096, 'min_length': 1}, + 'value': {'max_length': 4096}, } _attribute_map = { @@ -4691,6 +5699,7 @@ class NamedValueContract(Resource): 'secret': {'key': 'properties.secret', 'type': 'bool'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'value': {'key': 'properties.value', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractProperties'}, } def __init__(self, **kwargs): @@ -4699,6 +5708,7 @@ def __init__(self, **kwargs): self.secret = kwargs.get('secret', None) self.display_name = kwargs.get('display_name', None) self.value = kwargs.get('value', None) + self.key_vault = kwargs.get('key_vault', None) class NamedValueCreateContract(Resource): @@ -4724,11 +5734,14 @@ class NamedValueCreateContract(Resource): :param display_name: Required. Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. :type display_name: str - :param value: Required. Value of the NamedValue. Can contain policy - expressions. It may not be empty or consist only of whitespace. This - property will not be filled on 'GET' operations! Use '/listSecrets' POST - request to get the value. + :param value: Value of the NamedValue. Can contain policy expressions. It + may not be empty or consist only of whitespace. This property will not be + filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type value: str + :param key_vault: KeyVault location details of the namedValue. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -4737,7 +5750,7 @@ class NamedValueCreateContract(Resource): 'type': {'readonly': True}, 'tags': {'max_items': 32}, 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, + 'value': {'max_length': 4096}, } _attribute_map = { @@ -4748,6 +5761,7 @@ class NamedValueCreateContract(Resource): 'secret': {'key': 'properties.secret', 'type': 'bool'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'value': {'key': 'properties.value', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractCreateProperties'}, } def __init__(self, **kwargs): @@ -4756,6 +5770,7 @@ def __init__(self, **kwargs): self.secret = kwargs.get('secret', None) self.display_name = kwargs.get('display_name', None) self.value = kwargs.get('value', None) + self.key_vault = kwargs.get('key_vault', None) class NamedValueEntityBaseParameters(Model): @@ -4784,6 +5799,22 @@ def __init__(self, **kwargs): self.secret = kwargs.get('secret', None) +class NamedValueSecretContract(Model): + """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + + :param value: This is secret value of the NamedValue entity. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NamedValueSecretContract, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + class NamedValueUpdateParameters(Model): """NamedValue update Parameters. @@ -4799,6 +5830,9 @@ class NamedValueUpdateParameters(Model): :param value: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. :type value: str + :param key_vault: KeyVault location details of the namedValue. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -4812,6 +5846,7 @@ class NamedValueUpdateParameters(Model): 'secret': {'key': 'properties.secret', 'type': 'bool'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'value': {'key': 'properties.value', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractCreateProperties'}, } def __init__(self, **kwargs): @@ -4820,6 +5855,7 @@ def __init__(self, **kwargs): self.secret = kwargs.get('secret', None) self.display_name = kwargs.get('display_name', None) self.value = kwargs.get('value', None) + self.key_vault = kwargs.get('key_vault', None) class NetworkStatusContract(Model): @@ -5438,6 +6474,10 @@ class ParameterContract(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 = { @@ -5452,6 +6492,8 @@ class ParameterContract(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__(self, **kwargs): @@ -5462,6 +6504,8 @@ def __init__(self, **kwargs): 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(Model): @@ -5489,18 +6533,22 @@ class PolicyCollection(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'}, } def __init__(self, **kwargs): 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) @@ -5582,7 +6630,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 = { @@ -5598,7 +6646,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__(self, **kwargs): @@ -5656,6 +6704,145 @@ def __init__(self, **kwargs): self.user_registration = kwargs.get('user_registration', None) +class PortalRevisionContract(Resource): + """Portal revisions contract 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 description: Portal revision description. + :type description: str + :ivar status_details: Portal revision publishing status details. + :vartype status_details: str + :ivar status: Portal revision publishing status. Possible values include: + 'pending', 'publishing', 'completed', 'failed' + :vartype status: str or + ~azure.mgmt.apimanagement.models.PortalRevisionStatus + :param is_current: Indicates if the Portal Revision is public. + :type is_current: bool + :ivar created_date_time: Portal revision creation date and time. + :vartype created_date_time: datetime + :ivar updated_date_time: Last updated date and time. + :vartype updated_date_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'max_length': 2000}, + 'status_details': {'readonly': True, 'max_length': 2000}, + 'status': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'updated_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + 'updated_date_time': {'key': 'properties.updatedDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(PortalRevisionContract, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.status_details = None + self.status = None + self.is_current = kwargs.get('is_current', None) + self.created_date_time = None + self.updated_date_time = None + + +class PortalSettingsCollection(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(Model): """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. @@ -5799,7 +6986,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': {'required': True, 'max_length': 300, 'min_length': 1}, } @@ -5864,7 +7051,7 @@ class ProductEntityBaseParameters(Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, } _attribute_map = { @@ -5929,7 +7116,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}, } @@ -5989,7 +7176,7 @@ class ProductUpdateParameters(Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -6014,22 +7201,6 @@ def __init__(self, **kwargs): self.display_name = kwargs.get('display_name', None) -class PropertyValueContract(Model): - """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. - - :param value: This is secret value of the NamedValue entity. - :type value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PropertyValueContract, self).__init__(**kwargs) - self.value = kwargs.get('value', None) - - class QuotaCounterCollection(Model): """Paged Quota Counter list representation. @@ -6142,23 +7313,47 @@ def __init__(self, **kwargs): self.kb_transferred = kwargs.get('kb_transferred', None) +class QuotaCounterValueUpdateContract(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'properties.callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'properties.kbTransferred', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(QuotaCounterValueUpdateContract, self).__init__(**kwargs) + self.calls_count = kwargs.get('calls_count', None) + self.kb_transferred = kwargs.get('kb_transferred', None) + + class RecipientEmailCollection(Model): """Paged Recipient User list representation. :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'}, } def __init__(self, **kwargs): 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) @@ -6221,18 +7416,22 @@ class RecipientUserCollection(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'}, } def __init__(self, **kwargs): 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) @@ -6680,7 +7879,7 @@ class ResourceSku(Model): """Describes an available API Management SKU. :param name: Name of the Sku. Possible values include: 'Developer', - 'Standard', 'Premium', 'Basic', 'Consumption' + 'Standard', 'Premium', 'Basic', 'Consumption', 'Isolated' :type name: str or ~azure.mgmt.apimanagement.models.SkuType """ @@ -6976,7 +8175,7 @@ class SubscriptionContract(Resource): value. :type secondary_key: str :param state_comment: Optional subscription comment added by an - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing is enabled :type allow_tracing: bool @@ -7183,7 +8382,7 @@ class SubscriptionUpdateParameters(Model): 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :param state_comment: Comments describing subscription state change by the - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing can be enabled :type allow_tracing: bool @@ -7471,6 +8670,40 @@ def __init__(self, **kwargs): self.configuration_change_date = kwargs.get('configuration_change_date', 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(Model): """Terms of service contract properties. @@ -7620,7 +8853,7 @@ class UserCreateParameters(Model): password is generated. :type password: str :param app_type: Determines the type of application which send the create - user request. Default is old publisher portal. Possible values include: + user request. Default is legacy portal. Possible values include: 'portal', 'developerPortal' :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param confirmation: Determines the type of confirmation e-mail that will 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 1e014d4da659..d1ab079aaeef 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 @@ -13,11 +13,120 @@ from msrest.exceptions import HttpOperationError -class AccessInformationContract(Model): +class Resource(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) -> None: + 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 access_information_contract_id: Access Information type ('access' + or 'gitAccess') + :type access_information_contract_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'}, + 'access_information_contract_id': {'key': 'properties.id', 'type': 'str'}, + 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, + 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + } + + def __init__(self, *, access_information_contract_id: str=None, principal_id: str=None, enabled: bool=None, **kwargs) -> None: + super(AccessInformationContract, self).__init__(**kwargs) + self.access_information_contract_id = access_information_contract_id + self.principal_id = principal_id + self.enabled = enabled + + +class AccessInformationCreateParameters(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: str=None, primary_key: str=None, secondary_key: str=None, enabled: bool=None, **kwargs) -> None: + 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(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 @@ -31,14 +140,16 @@ class AccessInformationContract(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'}, } - def __init__(self, *, id: str=None, primary_key: str=None, secondary_key: str=None, enabled: bool=None, **kwargs) -> None: - super(AccessInformationContract, self).__init__(**kwargs) + def __init__(self, *, id: str=None, principal_id: str=None, primary_key: str=None, secondary_key: str=None, enabled: bool=None, **kwargs) -> None: + 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 @@ -74,15 +185,22 @@ class AdditionalLocation(Model): :param sku: Required. SKU properties of the API Management service. :type sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties + :param zones: A list of availability zones denoting where the resource + needs to come from. + :type zones: list[str] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management service in the additional location. Available only for - Basic, Standard and Premium SKU. + 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 which is deployed in an Internal Virtual Network in a particular additional location. Available only for Basic, - Standard and Premium SKU. + 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: @@ -107,55 +225,52 @@ class AdditionalLocation(Model): _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, + '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'}, } - def __init__(self, *, location: str, sku, virtual_network_configuration=None, disable_gateway: bool=False, **kwargs) -> None: + def __init__(self, *, location: str, sku, zones=None, public_ip_address_id: str=None, virtual_network_configuration=None, disable_gateway: bool=False, **kwargs) -> None: super(AdditionalLocation, self).__init__(**kwargs) self.location = location self.sku = sku + 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 -class Resource(Model): - """The Resource definition. +class ApiContactInformation(Model): + """API contact information. - 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 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) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None + def __init__(self, *, name: str=None, url: str=None, email: str=None, **kwargs) -> None: + super(ApiContactInformation, self).__init__(**kwargs) + self.name = name + self.url = url + self.email = email class ApiContract(Resource): @@ -183,7 +298,8 @@ class ApiContract(Resource): 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 @@ -205,6 +321,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. @@ -255,15 +378,18 @@ 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'}, 'path': {'key': 'properties.path', 'type': 'str'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'properties.protocols', 'type': '[str]'}, 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, } - def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None: + def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, terms_of_service_url: str=None, contact=None, license=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None: super(ApiContract, self).__init__(**kwargs) self.description = description self.authentication_settings = authentication_settings @@ -277,6 +403,9 @@ def __init__(self, *, path: str, description: str=None, authentication_settings= 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 @@ -302,7 +431,8 @@ class ApiEntityBaseContract(Model): 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 @@ -324,6 +454,13 @@ class ApiEntityBaseContract(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 = { @@ -347,9 +484,12 @@ class ApiEntityBaseContract(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__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, **kwargs) -> None: + def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, terms_of_service_url: str=None, contact=None, license=None, **kwargs) -> None: super(ApiEntityBaseContract, self).__init__(**kwargs) self.description = description self.authentication_settings = authentication_settings @@ -363,6 +503,9 @@ def __init__(self, *, description: str=None, authentication_settings=None, subsc 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): @@ -384,7 +527,8 @@ class ApiContractProperties(ApiEntityBaseContract): 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 @@ -406,6 +550,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. @@ -450,16 +601,19 @@ 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'}, 'path': {'key': 'path', 'type': 'str'}, - 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, 'api_version_set': {'key': 'apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, } - def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None: - 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) + def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, terms_of_service_url: str=None, contact=None, license=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, **kwargs) -> None: + 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 @@ -487,7 +641,8 @@ class ApiCreateOrUpdateParameter(Model): 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 @@ -509,6 +664,13 @@ class ApiCreateOrUpdateParameter(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. @@ -539,9 +701,10 @@ class ApiCreateOrUpdateParameter(Model): :type wsdl_selector: ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector :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: - 'SoapToRest', 'SoapPassThrough' + * `http` creates a REST API + * `soap` creates a SOAP pass-through API + * `websocket` creates websocket API. Possible values include: + 'SoapToRest', 'SoapPassThrough', 'WebSocket' :type soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ @@ -569,11 +732,14 @@ class ApiCreateOrUpdateParameter(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'}, 'path': {'key': 'properties.path', 'type': 'str'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'properties.protocols', 'type': '[str]'}, 'api_version_set': {'key': 'properties.apiVersionSet', 'type': 'ApiVersionSetContractDetails'}, 'value': {'key': 'properties.value', 'type': 'str'}, 'format': {'key': 'properties.format', 'type': 'str'}, @@ -581,7 +747,7 @@ class ApiCreateOrUpdateParameter(Model): 'soap_api_type': {'key': 'properties.apiType', 'type': 'str'}, } - def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, value: str=None, format=None, wsdl_selector=None, soap_api_type=None, **kwargs) -> None: + def __init__(self, *, path: str, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, terms_of_service_url: str=None, contact=None, license=None, source_api_id: str=None, display_name: str=None, service_url: str=None, protocols=None, api_version_set=None, value: str=None, format=None, wsdl_selector=None, soap_api_type=None, **kwargs) -> None: super(ApiCreateOrUpdateParameter, self).__init__(**kwargs) self.description = description self.authentication_settings = authentication_settings @@ -595,6 +761,9 @@ def __init__(self, *, path: str, description: str=None, authentication_settings= 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 @@ -671,6 +840,27 @@ def __init__(self, *, link: str=None, **kwargs) -> None: self.link = link +class ApiLicenseInformation(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: str=None, url: str=None, **kwargs) -> None: + super(ApiLicenseInformation, self).__init__(**kwargs) + self.name = name + self.url = url + + class ApiManagementServiceApplyNetworkConfigurationParameters(Model): """Parameter supplied to the Apply Network configuration operation. @@ -773,13 +963,18 @@ class ApiManagementServiceBaseProperties(Model): 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 and Premium SKU. + 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 and Premium - SKU. + 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: @@ -851,6 +1046,10 @@ class ApiManagementServiceBaseProperties(Model): 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. Default value: False . + :type restore: bool """ _validation = { @@ -882,6 +1081,7 @@ class ApiManagementServiceBaseProperties(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}'}, @@ -890,9 +1090,10 @@ class ApiManagementServiceBaseProperties(Model): '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'}, } - def __init__(self, *, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, **kwargs) -> None: + def __init__(self, *, notification_sender_email: str=None, hostname_configurations=None, public_ip_address_id: str=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, restore: bool=False, **kwargs) -> None: super(ApiManagementServiceBaseProperties, self).__init__(**kwargs) self.notification_sender_email = notification_sender_email self.provisioning_state = None @@ -907,6 +1108,7 @@ def __init__(self, *, notification_sender_email: str=None, hostname_configuratio 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 @@ -915,6 +1117,7 @@ def __init__(self, *, notification_sender_email: str=None, hostname_configuratio self.disable_gateway = disable_gateway self.virtual_network_type = virtual_network_type self.api_version_constraint = api_version_constraint + self.restore = restore class ApiManagementServiceCheckNameAvailabilityParameters(Model): @@ -939,6 +1142,29 @@ def __init__(self, *, name: str, **kwargs) -> None: self.name = name +class ApiManagementServiceGetDomainOwnershipIdentifierResult(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) -> None: + super(ApiManagementServiceGetDomainOwnershipIdentifierResult, self).__init__(**kwargs) + self.domain_ownership_identifier = None + + class ApiManagementServiceGetSsoTokenResult(Model): """The response of the GetSsoToken operation. @@ -1138,13 +1364,18 @@ class ApiManagementServiceResource(ApimResource): 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 and Premium SKU. + 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 and Premium - SKU. + 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: @@ -1216,6 +1447,10 @@ class ApiManagementServiceResource(ApimResource): 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. Default value: False . + :type restore: bool :param publisher_email: Required. Publisher email. :type publisher_email: str :param publisher_name: Required. Publisher name. @@ -1230,6 +1465,9 @@ class ApiManagementServiceResource(ApimResource): :type location: str :ivar etag: ETag of the resource. :vartype etag: str + :param zones: A list of availability zones denoting where the resource + needs to come from. + :type zones: list[str] """ _validation = { @@ -1273,6 +1511,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}'}, @@ -1281,15 +1520,17 @@ class ApiManagementServiceResource(ApimResource): 'disable_gateway': {'key': 'properties.disableGateway', 'type': 'bool'}, 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, 'api_version_constraint': {'key': 'properties.apiVersionConstraint', 'type': 'ApiVersionConstraint'}, + 'restore': {'key': 'properties.restore', 'type': 'bool'}, 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, 'identity': {'key': 'identity', 'type': 'ApiManagementServiceIdentity'}, 'location': {'key': 'location', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, } - def __init__(self, *, publisher_email: str, publisher_name: str, sku, location: str, tags=None, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, identity=None, **kwargs) -> None: + def __init__(self, *, publisher_email: str, publisher_name: str, sku, location: str, tags=None, notification_sender_email: str=None, hostname_configurations=None, public_ip_address_id: str=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, restore: bool=False, identity=None, zones=None, **kwargs) -> None: super(ApiManagementServiceResource, self).__init__(tags=tags, **kwargs) self.notification_sender_email = notification_sender_email self.provisioning_state = None @@ -1304,6 +1545,7 @@ def __init__(self, *, publisher_email: str, publisher_name: str, sku, location: 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 @@ -1312,12 +1554,14 @@ def __init__(self, *, publisher_email: str, publisher_name: str, sku, location: self.disable_gateway = disable_gateway self.virtual_network_type = virtual_network_type self.api_version_constraint = api_version_constraint + self.restore = restore self.publisher_email = publisher_email self.publisher_name = publisher_name self.sku = sku self.identity = identity self.location = location self.etag = None + self.zones = zones class ApiManagementServiceSkuProperties(Model): @@ -1326,7 +1570,7 @@ class ApiManagementServiceSkuProperties(Model): All required parameters must be populated in order to send to Azure. :param name: Required. Name of the Sku. Possible values include: - 'Developer', 'Standard', 'Premium', 'Basic', 'Consumption' + 'Developer', 'Standard', 'Premium', 'Basic', 'Consumption', 'Isolated' :type name: str or ~azure.mgmt.apimanagement.models.SkuType :param capacity: Required. Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. @@ -1401,13 +1645,18 @@ class ApiManagementServiceUpdateParameters(ApimResource): 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 and Premium SKU. + 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 and Premium - SKU. + 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: @@ -1479,6 +1728,10 @@ class ApiManagementServiceUpdateParameters(ApimResource): 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. Default value: False . + :type restore: bool :param publisher_email: Publisher email. :type publisher_email: str :param publisher_name: Publisher name. @@ -1532,6 +1785,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}'}, @@ -1540,6 +1794,7 @@ class ApiManagementServiceUpdateParameters(ApimResource): 'disable_gateway': {'key': 'properties.disableGateway', 'type': 'bool'}, 'virtual_network_type': {'key': 'properties.virtualNetworkType', 'type': 'str'}, 'api_version_constraint': {'key': 'properties.apiVersionConstraint', 'type': 'ApiVersionConstraint'}, + 'restore': {'key': 'properties.restore', 'type': 'bool'}, 'publisher_email': {'key': 'properties.publisherEmail', 'type': 'str'}, 'publisher_name': {'key': 'properties.publisherName', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'ApiManagementServiceSkuProperties'}, @@ -1547,7 +1802,7 @@ class ApiManagementServiceUpdateParameters(ApimResource): 'etag': {'key': 'etag', 'type': 'str'}, } - def __init__(self, *, tags=None, notification_sender_email: str=None, hostname_configurations=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, publisher_email: str=None, publisher_name: str=None, sku=None, identity=None, **kwargs) -> None: + def __init__(self, *, tags=None, notification_sender_email: str=None, hostname_configurations=None, public_ip_address_id: str=None, virtual_network_configuration=None, additional_locations=None, custom_properties=None, certificates=None, enable_client_certificate: bool=False, disable_gateway: bool=False, virtual_network_type="None", api_version_constraint=None, restore: bool=False, publisher_email: str=None, publisher_name: str=None, sku=None, identity=None, **kwargs) -> None: super(ApiManagementServiceUpdateParameters, self).__init__(tags=tags, **kwargs) self.notification_sender_email = notification_sender_email self.provisioning_state = None @@ -1562,6 +1817,7 @@ def __init__(self, *, tags=None, notification_sender_email: str=None, hostname_c 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 @@ -1570,6 +1826,7 @@ def __init__(self, *, tags=None, notification_sender_email: str=None, hostname_c self.disable_gateway = disable_gateway self.virtual_network_type = virtual_network_type self.api_version_constraint = api_version_constraint + self.restore = restore self.publisher_email = publisher_email self.publisher_name = publisher_name self.sku = sku @@ -1577,6 +1834,337 @@ def __init__(self, *, tags=None, notification_sender_email: str=None, hostname_c self.etag = None +class ApiManagementSku(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.

Possible Values:

**Standard**

**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) -> None: + 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(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) -> None: + super(ApiManagementSkuCapabilities, self).__init__(**kwargs) + self.name = None + self.value = None + + +class ApiManagementSkuCapacity(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': 'ApiManagementSkuCapacityScaleType'}, + } + + def __init__(self, **kwargs) -> None: + super(ApiManagementSkuCapacity, self).__init__(**kwargs) + self.minimum = None + self.maximum = None + self.default = None + self.scale_type = None + + +class ApiManagementSkuCosts(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) -> None: + super(ApiManagementSkuCosts, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class ApiManagementSkuLocationInfo(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) -> None: + super(ApiManagementSkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.zone_details = None + + +class ApiManagementSkuRestrictionInfo(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) -> None: + super(ApiManagementSkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class ApiManagementSkuRestrictions(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': 'ApiManagementSkuRestrictionsType'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'ApiManagementSkuRestrictionInfo'}, + 'reason_code': {'key': 'reasonCode', 'type': 'ApiManagementSkuRestrictionsReasonCode'}, + } + + def __init__(self, **kwargs) -> None: + super(ApiManagementSkuRestrictions, self).__init__(**kwargs) + self.type = None + self.values = None + self.restriction_info = None + self.reason_code = None + + +class ApiManagementSkuZoneDetails(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) -> None: + super(ApiManagementSkuZoneDetails, self).__init__(**kwargs) + self.name = None + self.capabilities = None + + class ApiReleaseContract(Resource): """ApiRelease details. @@ -1742,7 +2330,8 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): 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 @@ -1764,6 +2353,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. @@ -1805,15 +2401,18 @@ 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'}, 'path': {'key': 'path', 'type': 'str'}, - 'protocols': {'key': 'protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, } - def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, id: str=None, name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None: - 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) + def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, terms_of_service_url: str=None, contact=None, license=None, id: str=None, name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None: + 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 @@ -1838,7 +2437,8 @@ class ApiUpdateContract(Model): 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 @@ -1860,6 +2460,13 @@ class ApiUpdateContract(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 @@ -1899,13 +2506,16 @@ class ApiUpdateContract(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'}, - 'protocols': {'key': 'properties.protocols', 'type': '[Protocol]'}, + 'protocols': {'key': 'properties.protocols', 'type': '[str]'}, } - def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, display_name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None: + def __init__(self, *, description: str=None, authentication_settings=None, subscription_key_parameter_names=None, api_type=None, api_revision: str=None, api_version: str=None, is_current: bool=None, api_revision_description: str=None, api_version_description: str=None, api_version_set_id: str=None, subscription_required: bool=None, terms_of_service_url: str=None, contact=None, license=None, display_name: str=None, service_url: str=None, path: str=None, protocols=None, **kwargs) -> None: super(ApiUpdateContract, self).__init__(**kwargs) self.description = description self.authentication_settings = authentication_settings @@ -1919,6 +2529,9 @@ def __init__(self, *, description: str=None, authentication_settings=None, subsc 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 @@ -1967,7 +2580,7 @@ class ApiVersionSetContract(Resource): :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 will be located in a HTTP request. Possible values + 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 @@ -2015,7 +2628,7 @@ class ApiVersionSetContractDetails(Model): :param description: Description of API Version Set. :type description: str :param versioning_scheme: An value that determines where the API Version - identifer will be located in a HTTP request. Possible values include: + identifier will be located in a HTTP request. Possible values include: 'Segment', 'Query', 'Header' :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.enum :param version_query_name: Name of query parameter that indicates the API @@ -2090,7 +2703,7 @@ class ApiVersionSetUpdateParameters(Model): :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 located in a HTTP request. Possible values include: + identifier will be located in a HTTP request. Possible values include: 'Segment', 'Query', 'Header' :type versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme @@ -2383,6 +2996,34 @@ def __init__(self, *, description: str=None, authorization_methods=None, client_ self.resource_owner_password = resource_owner_password +class AuthorizationServerSecretsContract(Model): + """OAuth Server Secrets Contract. + + :param client_secret: oAuth Authorization Server Secrets. + :type client_secret: str + :param resource_owner_username: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner username. + :type resource_owner_username: str + :param resource_owner_password: Can be optionally specified when resource + owner password grant type is supported by this authorization server. + Default resource owner password. + :type resource_owner_password: str + """ + + _attribute_map = { + 'client_secret': {'key': 'clientSecret', 'type': 'str'}, + 'resource_owner_username': {'key': 'resourceOwnerUsername', 'type': 'str'}, + 'resource_owner_password': {'key': 'resourceOwnerPassword', 'type': 'str'}, + } + + def __init__(self, *, client_secret: str=None, resource_owner_username: str=None, resource_owner_password: str=None, **kwargs) -> None: + super(AuthorizationServerSecretsContract, self).__init__(**kwargs) + self.client_secret = client_secret + self.resource_owner_username = resource_owner_username + self.resource_owner_password = resource_owner_password + + class AuthorizationServerUpdateContract(Resource): """External OAuth authorization server settings. @@ -2664,7 +3305,10 @@ def __init__(self, *, url: str, protocol, title: str=None, description: str=None class BackendCredentialsContract(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]] @@ -2676,18 +3320,21 @@ class BackendCredentialsContract(Model): """ _validation = { + 'certificate_ids': {'max_items': 32}, 'certificate': {'max_items': 32}, } _attribute_map = { + 'certificate_ids': {'key': 'certificateIds', 'type': '[str]'}, 'certificate': {'key': 'certificate', 'type': '[str]'}, 'query': {'key': 'query', 'type': '{[str]}'}, 'header': {'key': 'header', 'type': '{[str]}'}, 'authorization': {'key': 'authorization', 'type': 'BackendAuthorizationHeaderCredentials'}, } - def __init__(self, *, certificate=None, query=None, header=None, authorization=None, **kwargs) -> None: + def __init__(self, *, certificate_ids=None, certificate=None, query=None, header=None, authorization=None, **kwargs) -> None: super(BackendCredentialsContract, self).__init__(**kwargs) + self.certificate_ids = certificate_ids self.certificate = certificate self.query = query self.header = header @@ -2783,8 +3430,11 @@ class BackendServiceFabricClusterProperties(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. @@ -2800,11 +3450,11 @@ class BackendServiceFabricClusterProperties(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]'}, @@ -2812,8 +3462,9 @@ class BackendServiceFabricClusterProperties(Model): 'server_x509_names': {'key': 'serverX509Names', 'type': '[X509CertificateName]'}, } - def __init__(self, *, client_certificatethumbprint: str, management_endpoints, max_partition_resolution_retries: int=None, server_certificate_thumbprints=None, server_x509_names=None, **kwargs) -> None: + def __init__(self, *, management_endpoints, client_certificate_id: str=None, client_certificatethumbprint: str=None, max_partition_resolution_retries: int=None, server_certificate_thumbprints=None, server_x509_names=None, **kwargs) -> None: 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 @@ -2942,6 +3593,9 @@ class CacheContract(Resource): :type description: str :param connection_string: Required. Runtime connection string to cache :type connection_string: str + :param use_from_location: Required. Location identifier to use cache from + (should be either 'default' or valid Azure region identifier) + :type use_from_location: str :param resource_id: Original uri of entity in external system cache points to :type resource_id: str @@ -2953,6 +3607,7 @@ class CacheContract(Resource): 'type': {'readonly': True}, 'description': {'max_length': 2000}, 'connection_string': {'required': True, 'max_length': 300}, + 'use_from_location': {'required': True, 'max_length': 256}, 'resource_id': {'max_length': 2000}, } @@ -2962,13 +3617,15 @@ class CacheContract(Resource): 'type': {'key': 'type', 'type': 'str'}, 'description': {'key': 'properties.description', 'type': 'str'}, 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'use_from_location': {'key': 'properties.useFromLocation', 'type': 'str'}, 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, } - def __init__(self, *, connection_string: str, description: str=None, resource_id: str=None, **kwargs) -> None: + def __init__(self, *, connection_string: str, use_from_location: str, description: str=None, resource_id: str=None, **kwargs) -> None: super(CacheContract, self).__init__(**kwargs) self.description = description self.connection_string = connection_string + self.use_from_location = use_from_location self.resource_id = resource_id @@ -2979,6 +3636,9 @@ class CacheUpdateParameters(Model): :type description: str :param connection_string: Runtime connection string to cache :type connection_string: str + :param use_from_location: Location identifier to use cache from (should be + either 'default' or valid Azure region identifier) + :type use_from_location: str :param resource_id: Original uri of entity in external system cache points to :type resource_id: str @@ -2987,19 +3647,22 @@ class CacheUpdateParameters(Model): _validation = { 'description': {'max_length': 2000}, 'connection_string': {'max_length': 300}, + 'use_from_location': {'max_length': 256}, 'resource_id': {'max_length': 2000}, } _attribute_map = { 'description': {'key': 'properties.description', 'type': 'str'}, 'connection_string': {'key': 'properties.connectionString', 'type': 'str'}, + 'use_from_location': {'key': 'properties.useFromLocation', 'type': 'str'}, 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, } - def __init__(self, *, description: str=None, connection_string: str=None, resource_id: str=None, **kwargs) -> None: + def __init__(self, *, description: str=None, connection_string: str=None, use_from_location: str=None, resource_id: str=None, **kwargs) -> None: super(CacheUpdateParameters, self).__init__(**kwargs) self.description = description self.connection_string = connection_string + self.use_from_location = use_from_location self.resource_id = resource_id @@ -3063,6 +3726,9 @@ class CertificateContract(Resource): date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. :type expiration_date: datetime + :param key_vault: KeyVault location details of the certificate. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ _validation = { @@ -3081,41 +3747,41 @@ class CertificateContract(Resource): 'subject': {'key': 'properties.subject', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, 'expiration_date': {'key': 'properties.expirationDate', 'type': 'iso-8601'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractProperties'}, } - def __init__(self, *, subject: str, thumbprint: str, expiration_date, **kwargs) -> None: + def __init__(self, *, subject: str, thumbprint: str, expiration_date, key_vault=None, **kwargs) -> None: super(CertificateContract, self).__init__(**kwargs) self.subject = subject self.thumbprint = thumbprint self.expiration_date = expiration_date + self.key_vault = key_vault class CertificateCreateOrUpdateParameters(Model): """Certificate create or update details. - All required parameters must be populated in order to send to Azure. - - :param data: Required. Base 64 encoded certificate using the - application/x-pkcs12 representation. + :param data: Base 64 encoded certificate using the application/x-pkcs12 + representation. :type data: str - :param password: Required. Password for the Certificate + :param password: Password for the Certificate :type password: str + :param key_vault: KeyVault location details of the certificate. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ - _validation = { - 'data': {'required': True}, - 'password': {'required': True}, - } - _attribute_map = { 'data': {'key': 'properties.data', 'type': 'str'}, 'password': {'key': 'properties.password', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractCreateProperties'}, } - def __init__(self, *, data: str, password: str, **kwargs) -> None: + def __init__(self, *, data: str=None, password: str=None, key_vault=None, **kwargs) -> None: super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) self.data = data self.password = password + self.key_vault = key_vault class CertificateInformation(Model): @@ -3204,6 +3870,10 @@ class ConnectivityStatusContract(Model): The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. :type last_status_change: datetime + :param resource_type: Required. Resource Type. + :type resource_type: str + :param is_optional: Required. Whether this is optional. + :type is_optional: bool """ _validation = { @@ -3211,6 +3881,8 @@ class ConnectivityStatusContract(Model): 'status': {'required': True}, 'last_updated': {'required': True}, 'last_status_change': {'required': True}, + 'resource_type': {'required': True}, + 'is_optional': {'required': True}, } _attribute_map = { @@ -3219,15 +3891,197 @@ class ConnectivityStatusContract(Model): 'error': {'key': 'error', 'type': 'str'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'last_status_change': {'key': 'lastStatusChange', 'type': 'iso-8601'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'is_optional': {'key': 'isOptional', 'type': 'bool'}, } - def __init__(self, *, name: str, status, last_updated, last_status_change, error: str=None, **kwargs) -> None: + def __init__(self, *, name: str, status, last_updated, last_status_change, resource_type: str, is_optional: bool, error: str=None, **kwargs) -> None: super(ConnectivityStatusContract, self).__init__(**kwargs) self.name = name self.status = status self.error = error self.last_updated = last_updated self.last_status_change = last_status_change + self.resource_type = resource_type + self.is_optional = is_optional + + +class ContentItemContract(Resource): + """Content type contract 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 properties: Properties of the content item. + :type properties: dict[str, object] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{object}'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(ContentItemContract, self).__init__(**kwargs) + self.properties = properties + + +class ContentTypeContract(Resource): + """Content type contract 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 content_type_contract_id: Content type identifier + :type content_type_contract_id: str + :param content_type_contract_name: Content type name. Must be 1 to 250 + characters long. + :type content_type_contract_name: str + :param description: Content type description. + :type description: str + :param schema: Content type schema. + :type schema: object + :param version: Content type version. + :type version: 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'}, + 'content_type_contract_id': {'key': 'properties.id', 'type': 'str'}, + 'content_type_contract_name': {'key': 'properties.name', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'schema': {'key': 'properties.schema', 'type': 'object'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + } + + def __init__(self, *, content_type_contract_id: str=None, content_type_contract_name: str=None, description: str=None, schema=None, version: str=None, **kwargs) -> None: + super(ContentTypeContract, self).__init__(**kwargs) + self.content_type_contract_id = content_type_contract_id + self.content_type_contract_name = content_type_contract_name + self.description = description + self.schema = schema + self.version = version + + +class DataMasking(Model): + """DataMasking. + + :param query_params: Masking settings for Url query parameters + :type query_params: + list[~azure.mgmt.apimanagement.models.DataMaskingEntity] + :param headers: Masking settings for headers + :type headers: list[~azure.mgmt.apimanagement.models.DataMaskingEntity] + """ + + _attribute_map = { + 'query_params': {'key': 'queryParams', 'type': '[DataMaskingEntity]'}, + 'headers': {'key': 'headers', 'type': '[DataMaskingEntity]'}, + } + + def __init__(self, *, query_params=None, headers=None, **kwargs) -> None: + super(DataMasking, self).__init__(**kwargs) + self.query_params = query_params + self.headers = headers + + +class DataMaskingEntity(Model): + """DataMaskingEntity. + + :param value: The name of an entity to mask (e.g. a name of a header or a + query parameter). + :type value: str + :param mode: Data masking mode. Possible values include: 'Mask', 'Hide' + :type mode: str or ~azure.mgmt.apimanagement.models.DataMaskingMode + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'mode': {'key': 'mode', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, mode=None, **kwargs) -> None: + super(DataMaskingEntity, self).__init__(**kwargs) + self.value = value + self.mode = mode + + +class DeletedServiceContract(Resource): + """Deleted Api Management Service information. + + 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 service_id: Fully-qualified API Management Service Resource ID + :type service_id: str + :param scheduled_purge_date: UTC Date and Time when the service will be + automatically purged. The date conforms to the following format: + yyyy-MM-ddTHH:mm:ssZ as specified by the ISO 8601 standard. + :type scheduled_purge_date: datetime + :param deletion_date: UTC Timestamp when the service was soft-deleted. The + date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified + by the ISO 8601 standard. + :type deletion_date: datetime + :ivar location: Api Management Service Master Location. + :vartype location: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'service_id': {'key': 'properties.serviceId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'properties.scheduledPurgeDate', 'type': 'iso-8601'}, + 'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'}, + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__(self, *, service_id: str=None, scheduled_purge_date=None, deletion_date=None, **kwargs) -> None: + super(DeletedServiceContract, self).__init__(**kwargs) + self.service_id = service_id + self.scheduled_purge_date = scheduled_purge_date + self.deletion_date = deletion_date + self.location = None class DeployConfigurationParameters(Model): @@ -3296,6 +4150,11 @@ class DiagnosticContract(Resource): :param verbosity: The verbosity level applied to traces emitted by trace policies. Possible values include: 'verbose', 'information', 'error' :type verbosity: str or ~azure.mgmt.apimanagement.models.Verbosity + :param operation_name_format: The format of the Operation Name for + Application Insights telemetries. Default is Name. Possible values + include: 'Name', 'Url' + :type operation_name_format: str or + ~azure.mgmt.apimanagement.models.OperationNameFormat """ _validation = { @@ -3317,9 +4176,10 @@ class DiagnosticContract(Resource): 'log_client_ip': {'key': 'properties.logClientIp', 'type': 'bool'}, 'http_correlation_protocol': {'key': 'properties.httpCorrelationProtocol', 'type': 'str'}, 'verbosity': {'key': 'properties.verbosity', 'type': 'str'}, + 'operation_name_format': {'key': 'properties.operationNameFormat', 'type': 'str'}, } - def __init__(self, *, logger_id: str, always_log=None, sampling=None, frontend=None, backend=None, log_client_ip: bool=None, http_correlation_protocol=None, verbosity=None, **kwargs) -> None: + def __init__(self, *, logger_id: str, always_log=None, sampling=None, frontend=None, backend=None, log_client_ip: bool=None, http_correlation_protocol=None, verbosity=None, operation_name_format=None, **kwargs) -> None: super(DiagnosticContract, self).__init__(**kwargs) self.always_log = always_log self.logger_id = logger_id @@ -3329,6 +4189,7 @@ def __init__(self, *, logger_id: str, always_log=None, sampling=None, frontend=N self.log_client_ip = log_client_ip self.http_correlation_protocol = http_correlation_protocol self.verbosity = verbosity + self.operation_name_format = operation_name_format class EmailTemplateContract(Resource): @@ -3537,16 +4398,50 @@ class ErrorResponseBody(Model): """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorFieldContract]'}, + } + + def __init__(self, *, code: str=None, message: str=None, details=None, **kwargs) -> None: + super(ErrorResponseBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.details = details + + +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, *, code: str=None, message: str=None, details=None, **kwargs) -> None: - super(ErrorResponseBody, self).__init__(**kwargs) - self.code = code - self.message = message - self.details = details + def __init__(self, *, is_trusted: bool=None, **kwargs) -> None: + super(GatewayCertificateAuthorityContract, self).__init__(**kwargs) + self.is_trusted = is_trusted class GatewayContract(Resource): @@ -3610,6 +4505,12 @@ class GatewayHostnameConfigurationContract(Resource): :param negotiate_client_certificate: Determines whether gateway requests client certificate :type negotiate_client_certificate: bool + :param tls10_enabled: Specifies if TLS 1.0 is supported + :type tls10_enabled: bool + :param tls11_enabled: Specifies if TLS 1.1 is supported + :type tls11_enabled: bool + :param http2_enabled: Specifies if HTTP/2.0 is supported + :type http2_enabled: bool """ _validation = { @@ -3625,13 +4526,19 @@ class GatewayHostnameConfigurationContract(Resource): 'hostname': {'key': 'properties.hostname', 'type': 'str'}, 'certificate_id': {'key': 'properties.certificateId', 'type': 'str'}, 'negotiate_client_certificate': {'key': 'properties.negotiateClientCertificate', 'type': 'bool'}, + 'tls10_enabled': {'key': 'properties.tls10Enabled', 'type': 'bool'}, + 'tls11_enabled': {'key': 'properties.tls11Enabled', 'type': 'bool'}, + 'http2_enabled': {'key': 'properties.http2Enabled', 'type': 'bool'}, } - def __init__(self, *, hostname: str=None, certificate_id: str=None, negotiate_client_certificate: bool=None, **kwargs) -> None: + def __init__(self, *, hostname: str=None, certificate_id: str=None, negotiate_client_certificate: bool=None, tls10_enabled: bool=None, tls11_enabled: bool=None, http2_enabled: bool=None, **kwargs) -> None: super(GatewayHostnameConfigurationContract, self).__init__(**kwargs) self.hostname = hostname self.certificate_id = certificate_id self.negotiate_client_certificate = negotiate_client_certificate + self.tls10_enabled = tls10_enabled + self.tls11_enabled = tls11_enabled + self.http2_enabled = http2_enabled class GatewayKeyRegenerationRequestContract(Model): @@ -3937,9 +4844,13 @@ class HostnameConfiguration(Model): :param key_vault_id: Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to - be configured with MSI. The secret should be of type + be configured with aka.ms/apimmsi. The secret should be of type *application/x-pkcs12* :type key_vault_id: str + :param identity_client_id: System or User Assigned Managed identity + clientId as generated by Azure AD, which has GET access to the keyVault + containing the SSL certificate. + :type identity_client_id: str :param encoded_certificate: Base64 Encoded certificate. :type encoded_certificate: str :param certificate_password: Certificate Password. @@ -3957,6 +4868,14 @@ class HostnameConfiguration(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 = { @@ -3968,23 +4887,29 @@ class HostnameConfiguration(Model): 'type': {'key': 'type', 'type': 'str'}, 'host_name': {'key': 'hostName', 'type': 'str'}, 'key_vault_id': {'key': 'keyVaultId', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, 'encoded_certificate': {'key': 'encodedCertificate', 'type': 'str'}, 'certificate_password': {'key': 'certificatePassword', 'type': 'str'}, '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__(self, *, type, host_name: str, key_vault_id: str=None, encoded_certificate: str=None, certificate_password: str=None, default_ssl_binding: bool=False, negotiate_client_certificate: bool=False, certificate=None, **kwargs) -> None: + def __init__(self, *, type, host_name: str, key_vault_id: str=None, identity_client_id: str=None, encoded_certificate: str=None, certificate_password: str=None, default_ssl_binding: bool=False, negotiate_client_certificate: bool=False, certificate=None, certificate_source=None, certificate_status=None, **kwargs) -> None: super(HostnameConfiguration, self).__init__(**kwargs) self.type = type self.host_name = host_name self.key_vault_id = key_vault_id + self.identity_client_id = identity_client_id self.encoded_certificate = encoded_certificate self.certificate_password = certificate_password 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(Model): @@ -3994,17 +4919,21 @@ class HttpMessageDiagnostic(Model): :type headers: list[str] :param body: Body logging settings. :type body: ~azure.mgmt.apimanagement.models.BodyDiagnosticSettings + :param data_masking: Data masking settings. + :type data_masking: ~azure.mgmt.apimanagement.models.DataMasking """ _attribute_map = { 'headers': {'key': 'headers', 'type': '[str]'}, 'body': {'key': 'body', 'type': 'BodyDiagnosticSettings'}, + 'data_masking': {'key': 'dataMasking', 'type': 'DataMasking'}, } - def __init__(self, *, headers=None, body=None, **kwargs) -> None: + def __init__(self, *, headers=None, body=None, data_masking=None, **kwargs) -> None: super(HttpMessageDiagnostic, self).__init__(**kwargs) self.headers = headers self.body = body + self.data_masking = data_masking class IdentityProviderBaseParameters(Model): @@ -4554,6 +5483,83 @@ def __init__(self, *, created_date=None, state=None, api_id: str=None, title: st self.user_id = user_id +class KeyVaultContractCreateProperties(Model): + """Create keyVault contract details. + + :param secret_identifier: Key vault secret identifier for fetching secret. + Providing a versioned secret will prevent auto-refresh. This requires Api + Management service to be configured with aka.ms/apimmsi + :type secret_identifier: str + :param identity_client_id: SystemAssignedIdentity or UserAssignedIdentity + Client Id which will be used to access key vault secret. + :type identity_client_id: str + """ + + _attribute_map = { + 'secret_identifier': {'key': 'secretIdentifier', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + } + + def __init__(self, *, secret_identifier: str=None, identity_client_id: str=None, **kwargs) -> None: + super(KeyVaultContractCreateProperties, self).__init__(**kwargs) + self.secret_identifier = secret_identifier + self.identity_client_id = identity_client_id + + +class KeyVaultContractProperties(KeyVaultContractCreateProperties): + """KeyVault contract details. + + :param secret_identifier: Key vault secret identifier for fetching secret. + Providing a versioned secret will prevent auto-refresh. This requires Api + Management service to be configured with aka.ms/apimmsi + :type secret_identifier: str + :param identity_client_id: SystemAssignedIdentity or UserAssignedIdentity + Client Id which will be used to access key vault secret. + :type identity_client_id: str + :param last_status: Last time sync and refresh status of secret from key + vault. + :type last_status: + ~azure.mgmt.apimanagement.models.KeyVaultLastAccessStatusContractProperties + """ + + _attribute_map = { + 'secret_identifier': {'key': 'secretIdentifier', 'type': 'str'}, + 'identity_client_id': {'key': 'identityClientId', 'type': 'str'}, + 'last_status': {'key': 'lastStatus', 'type': 'KeyVaultLastAccessStatusContractProperties'}, + } + + def __init__(self, *, secret_identifier: str=None, identity_client_id: str=None, last_status=None, **kwargs) -> None: + super(KeyVaultContractProperties, self).__init__(secret_identifier=secret_identifier, identity_client_id=identity_client_id, **kwargs) + self.last_status = last_status + + +class KeyVaultLastAccessStatusContractProperties(Model): + """Issue contract Update Properties. + + :param code: Last status code for sync and refresh of secret from key + vault. + :type code: str + :param message: Details of the error else empty. + :type message: str + :param time_stamp_utc: Last time secret was accessed. The date conforms to + the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 + standard. + :type time_stamp_utc: datetime + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'time_stamp_utc': {'key': 'timeStampUtc', 'type': 'iso-8601'}, + } + + def __init__(self, *, code: str=None, message: str=None, time_stamp_utc=None, **kwargs) -> None: + super(KeyVaultLastAccessStatusContractProperties, self).__init__(**kwargs) + self.code = code + self.message = message + self.time_stamp_utc = time_stamp_utc + + class LoggerContract(Resource): """Logger details. @@ -4569,12 +5575,12 @@ class LoggerContract(Resource): :ivar type: Resource type for API Management resource. :vartype type: str :param logger_type: Required. Logger type. Possible values include: - 'azureEventHub', 'applicationInsights' + 'azureEventHub', 'applicationInsights', 'azureMonitor' :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :param description: Logger description. :type description: str - :param credentials: Required. The name and SendRule connection string of - the event hub for azureEventHub logger. + :param credentials: The name and SendRule connection string of the event + hub for azureEventHub logger. Instrumentation key for applicationInsights logger. :type credentials: dict[str, str] :param is_buffered: Whether records are buffered in the logger before @@ -4591,7 +5597,6 @@ class LoggerContract(Resource): 'type': {'readonly': True}, 'logger_type': {'required': True}, 'description': {'max_length': 256}, - 'credentials': {'required': True}, } _attribute_map = { @@ -4605,7 +5610,7 @@ class LoggerContract(Resource): 'resource_id': {'key': 'properties.resourceId', 'type': 'str'}, } - def __init__(self, *, logger_type, credentials, description: str=None, is_buffered: bool=None, resource_id: str=None, **kwargs) -> None: + def __init__(self, *, logger_type, description: str=None, credentials=None, is_buffered: bool=None, resource_id: str=None, **kwargs) -> None: super(LoggerContract, self).__init__(**kwargs) self.logger_type = logger_type self.description = description @@ -4618,7 +5623,7 @@ class LoggerUpdateContract(Model): """Logger update contract. :param logger_type: Logger type. Possible values include: 'azureEventHub', - 'applicationInsights' + 'applicationInsights', 'azureMonitor' :type logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :param description: Logger description. :type description: str @@ -4672,6 +5677,9 @@ class NamedValueContract(Resource): filled on 'GET' operations! Use '/listSecrets' POST request to get the value. :type value: str + :param key_vault: KeyVault location details of the namedValue. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ _validation = { @@ -4680,7 +5688,7 @@ class NamedValueContract(Resource): 'type': {'readonly': True}, 'tags': {'max_items': 32}, 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'max_length': 4096, 'min_length': 1}, + 'value': {'max_length': 4096}, } _attribute_map = { @@ -4691,14 +5699,16 @@ class NamedValueContract(Resource): 'secret': {'key': 'properties.secret', 'type': 'bool'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'value': {'key': 'properties.value', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractProperties'}, } - def __init__(self, *, display_name: str, tags=None, secret: bool=None, value: str=None, **kwargs) -> None: + def __init__(self, *, display_name: str, tags=None, secret: bool=None, value: str=None, key_vault=None, **kwargs) -> None: super(NamedValueContract, self).__init__(**kwargs) self.tags = tags self.secret = secret self.display_name = display_name self.value = value + self.key_vault = key_vault class NamedValueCreateContract(Resource): @@ -4724,11 +5734,14 @@ class NamedValueCreateContract(Resource): :param display_name: Required. Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. :type display_name: str - :param value: Required. Value of the NamedValue. Can contain policy - expressions. It may not be empty or consist only of whitespace. This - property will not be filled on 'GET' operations! Use '/listSecrets' POST - request to get the value. + :param value: Value of the NamedValue. Can contain policy expressions. It + may not be empty or consist only of whitespace. This property will not be + filled on 'GET' operations! Use '/listSecrets' POST request to get the + value. :type value: str + :param key_vault: KeyVault location details of the namedValue. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -4737,7 +5750,7 @@ class NamedValueCreateContract(Resource): 'type': {'readonly': True}, 'tags': {'max_items': 32}, 'display_name': {'required': True, 'max_length': 256, 'min_length': 1, 'pattern': r'^[A-Za-z0-9-._]+$'}, - 'value': {'required': True, 'max_length': 4096, 'min_length': 1}, + 'value': {'max_length': 4096}, } _attribute_map = { @@ -4748,14 +5761,16 @@ class NamedValueCreateContract(Resource): 'secret': {'key': 'properties.secret', 'type': 'bool'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'value': {'key': 'properties.value', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractCreateProperties'}, } - def __init__(self, *, display_name: str, value: str, tags=None, secret: bool=None, **kwargs) -> None: + def __init__(self, *, display_name: str, tags=None, secret: bool=None, value: str=None, key_vault=None, **kwargs) -> None: super(NamedValueCreateContract, self).__init__(**kwargs) self.tags = tags self.secret = secret self.display_name = display_name self.value = value + self.key_vault = key_vault class NamedValueEntityBaseParameters(Model): @@ -4784,6 +5799,22 @@ def __init__(self, *, tags=None, secret: bool=None, **kwargs) -> None: self.secret = secret +class NamedValueSecretContract(Model): + """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + + :param value: This is secret value of the NamedValue entity. + :type value: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str=None, **kwargs) -> None: + super(NamedValueSecretContract, self).__init__(**kwargs) + self.value = value + + class NamedValueUpdateParameters(Model): """NamedValue update Parameters. @@ -4799,6 +5830,9 @@ class NamedValueUpdateParameters(Model): :param value: Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. :type value: str + :param key_vault: KeyVault location details of the namedValue. + :type key_vault: + ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -4812,14 +5846,16 @@ class NamedValueUpdateParameters(Model): 'secret': {'key': 'properties.secret', 'type': 'bool'}, 'display_name': {'key': 'properties.displayName', 'type': 'str'}, 'value': {'key': 'properties.value', 'type': 'str'}, + 'key_vault': {'key': 'properties.keyVault', 'type': 'KeyVaultContractCreateProperties'}, } - def __init__(self, *, tags=None, secret: bool=None, display_name: str=None, value: str=None, **kwargs) -> None: + def __init__(self, *, tags=None, secret: bool=None, display_name: str=None, value: str=None, key_vault=None, **kwargs) -> None: super(NamedValueUpdateParameters, self).__init__(**kwargs) self.tags = tags self.secret = secret self.display_name = display_name self.value = value + self.key_vault = key_vault class NetworkStatusContract(Model): @@ -5438,6 +6474,10 @@ class ParameterContract(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 = { @@ -5452,9 +6492,11 @@ class ParameterContract(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__(self, *, name: str, type: str, description: str=None, default_value: str=None, required: bool=None, values=None, **kwargs) -> None: + def __init__(self, *, name: str, type: str, description: str=None, default_value: str=None, required: bool=None, values=None, schema_id: str=None, type_name: str=None, **kwargs) -> None: super(ParameterContract, self).__init__(**kwargs) self.name = name self.description = description @@ -5462,6 +6504,8 @@ def __init__(self, *, name: str, type: str, description: str=None, default_value self.default_value = default_value self.required = required self.values = values + self.schema_id = schema_id + self.type_name = type_name class PipelineDiagnosticSettings(Model): @@ -5489,18 +6533,22 @@ class PolicyCollection(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'}, } - def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + def __init__(self, *, value=None, count: int=None, next_link: str=None, **kwargs) -> None: super(PolicyCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -5582,7 +6630,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 = { @@ -5598,7 +6646,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__(self, **kwargs) -> None: @@ -5656,6 +6704,145 @@ def __init__(self, *, url: str=None, validation_key: str=None, subscriptions=Non self.user_registration = user_registration +class PortalRevisionContract(Resource): + """Portal revisions contract 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 description: Portal revision description. + :type description: str + :ivar status_details: Portal revision publishing status details. + :vartype status_details: str + :ivar status: Portal revision publishing status. Possible values include: + 'pending', 'publishing', 'completed', 'failed' + :vartype status: str or + ~azure.mgmt.apimanagement.models.PortalRevisionStatus + :param is_current: Indicates if the Portal Revision is public. + :type is_current: bool + :ivar created_date_time: Portal revision creation date and time. + :vartype created_date_time: datetime + :ivar updated_date_time: Last updated date and time. + :vartype updated_date_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'description': {'max_length': 2000}, + 'status_details': {'readonly': True, 'max_length': 2000}, + 'status': {'readonly': True}, + 'created_date_time': {'readonly': True}, + 'updated_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'status_details': {'key': 'properties.statusDetails', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'is_current': {'key': 'properties.isCurrent', 'type': 'bool'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + 'updated_date_time': {'key': 'properties.updatedDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, description: str=None, is_current: bool=None, **kwargs) -> None: + super(PortalRevisionContract, self).__init__(**kwargs) + self.description = description + self.status_details = None + self.status = None + self.is_current = is_current + self.created_date_time = None + self.updated_date_time = None + + +class PortalSettingsCollection(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=None, count: int=None, **kwargs) -> None: + 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: str=None, validation_key: str=None, subscriptions=None, user_registration=None, enabled: bool=None, terms_of_service=None, **kwargs) -> None: + 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(Model): """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. @@ -5799,7 +6986,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': {'required': True, 'max_length': 300, 'min_length': 1}, } @@ -5864,7 +7051,7 @@ class ProductEntityBaseParameters(Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, } _attribute_map = { @@ -5929,7 +7116,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}, } @@ -5989,7 +7176,7 @@ class ProductUpdateParameters(Model): """ _validation = { - 'description': {'max_length': 1000, 'min_length': 1}, + 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, } @@ -6014,22 +7201,6 @@ def __init__(self, *, description: str=None, terms: str=None, subscription_requi self.display_name = display_name -class PropertyValueContract(Model): - """Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. - - :param value: This is secret value of the NamedValue entity. - :type value: str - """ - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - } - - def __init__(self, *, value: str=None, **kwargs) -> None: - super(PropertyValueContract, self).__init__(**kwargs) - self.value = value - - class QuotaCounterCollection(Model): """Paged Quota Counter list representation. @@ -6142,23 +7313,47 @@ def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwarg self.kb_transferred = kb_transferred +class QuotaCounterValueUpdateContract(Model): + """Quota counter value details. + + :param calls_count: Number of times Counter was called. + :type calls_count: int + :param kb_transferred: Data Transferred in KiloBytes. + :type kb_transferred: float + """ + + _attribute_map = { + 'calls_count': {'key': 'properties.callsCount', 'type': 'int'}, + 'kb_transferred': {'key': 'properties.kbTransferred', 'type': 'float'}, + } + + def __init__(self, *, calls_count: int=None, kb_transferred: float=None, **kwargs) -> None: + super(QuotaCounterValueUpdateContract, self).__init__(**kwargs) + self.calls_count = calls_count + self.kb_transferred = kb_transferred + + class RecipientEmailCollection(Model): """Paged Recipient User list representation. :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'}, } - def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + def __init__(self, *, value=None, count: int=None, next_link: str=None, **kwargs) -> None: super(RecipientEmailCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -6221,18 +7416,22 @@ class RecipientUserCollection(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'}, } - def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + def __init__(self, *, value=None, count: int=None, next_link: str=None, **kwargs) -> None: super(RecipientUserCollection, self).__init__(**kwargs) self.value = value + self.count = count self.next_link = next_link @@ -6680,7 +7879,7 @@ class ResourceSku(Model): """Describes an available API Management SKU. :param name: Name of the Sku. Possible values include: 'Developer', - 'Standard', 'Premium', 'Basic', 'Consumption' + 'Standard', 'Premium', 'Basic', 'Consumption', 'Isolated' :type name: str or ~azure.mgmt.apimanagement.models.SkuType """ @@ -6976,7 +8175,7 @@ class SubscriptionContract(Resource): value. :type secondary_key: str :param state_comment: Optional subscription comment added by an - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing is enabled :type allow_tracing: bool @@ -7183,7 +8382,7 @@ class SubscriptionUpdateParameters(Model): 'suspended', 'active', 'expired', 'submitted', 'rejected', 'cancelled' :type state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :param state_comment: Comments describing subscription state change by the - administrator. + administrator when the state is changed to the 'rejected'. :type state_comment: str :param allow_tracing: Determines whether tracing can be enabled :type allow_tracing: bool @@ -7471,6 +8670,40 @@ def __init__(self, *, branch: str=None, commit_id: str=None, is_export: bool=Non self.configuration_change_date = configuration_change_date +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=None, **kwargs) -> None: + super(TenantSettingsContract, self).__init__(**kwargs) + self.settings = settings + + class TermsOfServiceProperties(Model): """Terms of service contract properties. @@ -7620,7 +8853,7 @@ class UserCreateParameters(Model): password is generated. :type password: str :param app_type: Determines the type of application which send the create - user request. Default is old publisher portal. Possible values include: + user request. Default is legacy portal. Possible values include: 'portal', 'developerPortal' :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param confirmation: Determines the type of confirmation e-mail that will diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py index bc1ee244cc6c..c194622ada12 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_paged_models.py @@ -246,6 +246,45 @@ class CertificateContractPaged(Paged): def __init__(self, *args, **kwargs): super(CertificateContractPaged, self).__init__(*args, **kwargs) +class ContentTypeContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ContentTypeContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ContentTypeContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ContentTypeContractPaged, self).__init__(*args, **kwargs) +class ContentItemContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`ContentItemContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ContentItemContract]'} + } + + def __init__(self, *args, **kwargs): + + super(ContentItemContractPaged, self).__init__(*args, **kwargs) +class DeletedServiceContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedServiceContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedServiceContract]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedServiceContractPaged, self).__init__(*args, **kwargs) class OperationPaged(Paged): """ A paging container for iterating over a list of :class:`Operation ` object @@ -324,6 +363,19 @@ class GatewayHostnameConfigurationContractPaged(Paged): def __init__(self, *args, **kwargs): super(GatewayHostnameConfigurationContractPaged, self).__init__(*args, **kwargs) +class GatewayCertificateAuthorityContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`GatewayCertificateAuthorityContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GatewayCertificateAuthorityContract]'} + } + + def __init__(self, *args, **kwargs): + + super(GatewayCertificateAuthorityContractPaged, self).__init__(*args, **kwargs) class GroupContractPaged(Paged): """ A paging container for iterating over a list of :class:`GroupContract ` object @@ -415,6 +467,19 @@ class OpenidConnectProviderContractPaged(Paged): def __init__(self, *args, **kwargs): super(OpenidConnectProviderContractPaged, self).__init__(*args, **kwargs) +class PortalRevisionContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`PortalRevisionContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PortalRevisionContract]'} + } + + def __init__(self, *args, **kwargs): + + super(PortalRevisionContractPaged, self).__init__(*args, **kwargs) class SubscriptionContractPaged(Paged): """ A paging container for iterating over a list of :class:`SubscriptionContract ` object @@ -467,6 +532,45 @@ class RequestReportRecordContractPaged(Paged): def __init__(self, *args, **kwargs): super(RequestReportRecordContractPaged, self).__init__(*args, **kwargs) +class TenantSettingsContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`TenantSettingsContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TenantSettingsContract]'} + } + + def __init__(self, *args, **kwargs): + + super(TenantSettingsContractPaged, self).__init__(*args, **kwargs) +class ApiManagementSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ApiManagementSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ApiManagementSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ApiManagementSkuPaged, self).__init__(*args, **kwargs) +class AccessInformationContractPaged(Paged): + """ + A paging container for iterating over a list of :class:`AccessInformationContract ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AccessInformationContract]'} + } + + def __init__(self, *args, **kwargs): + + super(AccessInformationContractPaged, self).__init__(*args, **kwargs) class UserIdentityContractPaged(Paged): """ A paging container for iterating over a list of :class:`UserIdentityContract ` object 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 2dae331a8203..f1985f579930 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 @@ -29,6 +29,9 @@ from ._backend_operations import BackendOperations from ._cache_operations import CacheOperations from ._certificate_operations import CertificateOperations +from ._content_type_operations import ContentTypeOperations +from ._content_item_operations import ContentItemOperations +from ._deleted_services_operations import DeletedServicesOperations from ._api_management_operations import ApiManagementOperations from ._api_management_service_skus_operations import ApiManagementServiceSkusOperations from ._api_management_service_operations import ApiManagementServiceOperations @@ -37,6 +40,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 @@ -50,6 +54,8 @@ from ._open_id_connect_provider_operations import OpenIdConnectProviderOperations 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 @@ -62,6 +68,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 @@ -95,6 +103,9 @@ 'BackendOperations', 'CacheOperations', 'CertificateOperations', + 'ContentTypeOperations', + 'ContentItemOperations', + 'DeletedServicesOperations', 'ApiManagementOperations', 'ApiManagementServiceSkusOperations', 'ApiManagementServiceOperations', @@ -103,6 +114,7 @@ 'GatewayOperations', 'GatewayHostnameConfigurationOperations', 'GatewayApiOperations', + 'GatewayCertificateAuthorityOperations', 'GroupOperations', 'GroupUserOperations', 'IdentityProviderOperations', @@ -116,6 +128,8 @@ 'OpenIdConnectProviderOperations', 'PolicyOperations', 'PolicyDescriptionOperations', + 'PortalRevisionOperations', + 'PortalSettingsOperations', 'SignInSettingsOperations', 'SignUpSettingsOperations', 'DelegationSettingsOperations', @@ -128,6 +142,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 57f5d5b49878..208475a04b02 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 @@ -24,7 +24,7 @@ class ApiDiagnosticOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,11 +49,11 @@ def list_by_service( :param api_id: API identifier. Must be unique in the current API Management service instance. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -382,8 +382,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: DiagnosticContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -404,6 +405,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -420,12 +422,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DiagnosticContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} def delete( 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 ab05e246f647..4317ac56a99f 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 @@ -25,7 +25,7 @@ class ApiExportOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar export: Query parameter required to export the API details. Constant value: "true". - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.export = "true" - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 91257c1171a5..46658febf968 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 @@ -24,7 +24,7 @@ class ApiIssueAttachmentOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -52,12 +52,12 @@ def list_by_service( :param issue_id: Issue identifier. Must be unique in the current API Management service instance. :type issue_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
+ startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt + | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 513853155a04..e1661fb2e7c0 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 @@ -24,7 +24,7 @@ class ApiIssueCommentOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -52,12 +52,12 @@ def list_by_service( :param issue_id: Issue identifier. Must be unique in the current API Management service instance. :type issue_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
+ startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt + | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 36d063df0a8e..ae66b7e6c45e 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 @@ -24,7 +24,7 @@ class ApiIssueOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,13 +49,13 @@ def list_by_service( :param api_id: API identifier. Must be unique in the current API Management service instance. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| state | filter - | eq | |
+ startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt + | substringof, contains, startswith, endswith |
| state | filter | + eq | |
:type filter: str :param expand_comments_attachments: Expand the comment attachments. :type expand_comments_attachments: bool @@ -390,8 +390,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: IssueContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IssueContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -412,6 +413,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -428,12 +430,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IssueContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} def delete( diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations.py index e221fb1e1faa..0d1a5eb1a30f 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class ApiManagementOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -52,7 +51,8 @@ def list( :return: An iterator like instance of Operation :rtype: ~azure.mgmt.apimanagement.models.OperationPaged[~azure.mgmt.apimanagement.models.Operation] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -87,9 +87,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return 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 7daa7858229f..164d64c5608e 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -27,7 +26,7 @@ class ApiManagementServiceOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -37,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -689,7 +688,8 @@ def list( :return: An iterator like instance of ApiManagementServiceResource :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceResourcePaged[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -728,9 +728,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -871,6 +869,63 @@ def check_name_availability( return deserialized check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability'} + def get_domain_ownership_identifier( + self, custom_headers=None, raw=False, **operation_config): + """Get the custom domain ownership identifier for an API Management + service. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ApiManagementServiceGetDomainOwnershipIdentifierResult or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.apimanagement.models.ApiManagementServiceGetDomainOwnershipIdentifierResult + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_domain_ownership_identifier.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApiManagementServiceGetDomainOwnershipIdentifierResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier'} + def _apply_network_configuration_updates_initial( self, resource_group_name, service_name, location=None, custom_headers=None, raw=False, **operation_config): @@ -929,7 +984,7 @@ def _apply_network_configuration_updates_initial( def apply_network_configuration_updates( self, resource_group_name, service_name, location=None, custom_headers=None, raw=False, polling=True, **operation_config): """Updates the Microsoft.ApiManagement resource running in the Virtual - network to pick the updated network settings. + network to pick the updated 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 bfe3b31eb23d..8d67e6387f22 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 @@ -24,7 +24,7 @@ class ApiManagementServiceSkusOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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..1aafbc4e0292 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ApiManagementSkusOperations(object): + """ApiManagementSkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets the list of Microsoft.ApiManagement SKUs available for your + Subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ApiManagementSku + :rtype: + ~azure.mgmt.apimanagement.models.ApiManagementSkuPaged[~azure.mgmt.apimanagement.models.ApiManagementSku] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ApiManagementSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus'} 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 547d6e392dcb..ab4218d9c96e 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 @@ -24,7 +24,7 @@ class ApiOperationOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -50,17 +50,17 @@ def list_by_api( API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| method | + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| description | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| urlTemplate | + endswith |
| description | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
+ endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -397,8 +397,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: OperationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.OperationContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -419,6 +420,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -435,12 +437,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OperationContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} def delete( 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 522445c42c20..24df863ae105 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 @@ -24,7 +24,7 @@ class ApiOperationPolicyOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". :ivar policy_id: The identifier of the Policy. Constant value: "policy". """ @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.policy_id = "policy" self.config = config 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 17e65e2bf741..1db3a2994ff3 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 @@ -26,7 +26,7 @@ class ApiOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -48,17 +48,17 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| path | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
+ startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, + lt | substringof, contains, startswith, endswith |
| path | filter + | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
| isCurrent | filter | eq, ne | |
:type filter: str :param top: Number of records to return. :type top: int @@ -423,8 +423,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: ApiContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -444,6 +445,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -460,12 +462,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApiContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} def delete( @@ -542,22 +555,19 @@ def list_by_tags( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Supported operators | Supported - functions | - |-------------|------------------------|-----------------------------------| - |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith| - |displayName | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith| - |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith| - |path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith| - |description | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith| - |serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith| - |isCurrent | eq | | + :param filter: | Field | Usage | Supported + operators | Supported functions + |
|-------------|-------------|-------------|-------------|
| + name | filter | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| + apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| description | + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| isCurrent | filter + | eq | |
:type filter: str :param top: Number of records to return. :type top: int 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 195c7415eb56..9e1b1549cf03 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 @@ -24,7 +24,7 @@ class ApiPolicyOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". :ivar policy_id: The identifier of the Policy. Constant value: "policy". """ @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.policy_id = "policy" self.config = config 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 14b7f8245e8a..86df216315b0 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 @@ -24,7 +24,7 @@ class ApiProductOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,11 +49,11 @@ def list_by_apis( :param api_id: API identifier. Must be unique in the current API Management service instance. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 4ad883413357..b90c8be05785 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 @@ -24,7 +24,7 @@ class ApiReleaseOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -52,11 +52,11 @@ def list_by_service( :param api_id: API identifier. Must be unique in the current API Management service instance. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| notes | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -389,8 +389,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: ApiReleaseContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -413,6 +414,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -429,12 +431,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApiReleaseContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} def delete( 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 c69ddf7d3e3e..a34c127fedfc 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 @@ -24,7 +24,7 @@ class ApiRevisionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,11 +49,11 @@ def list_by_service( :param api_id: API identifier. Must be unique in the current API Management service instance. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 d681f90359af..939a983c3999 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 @@ -26,7 +26,7 @@ class ApiSchemaOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -36,7 +36,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -52,11 +52,11 @@ def list_by_api( API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| contentType | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 ee1c4ece98cd..b6a1915b2b20 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 @@ -24,7 +24,7 @@ class ApiTagDescriptionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -52,12 +52,12 @@ def list_by_service( API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
+ startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 58db85d6f681..5d8287c53ef6 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 @@ -24,7 +24,7 @@ class ApiVersionSetOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -47,8 +47,8 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
:type filter: str :param top: Number of records to return. @@ -362,8 +362,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: ApiVersionSetContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -383,6 +384,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -399,12 +401,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ApiVersionSetContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} def delete( 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 9ec7b59cd053..2a69673dabac 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 @@ -24,7 +24,7 @@ class AuthorizationServerOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -47,12 +47,12 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
+ startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -364,8 +364,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: AuthorizationServerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract + or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -385,6 +386,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -401,12 +403,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AuthorizationServerContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} def delete( @@ -484,8 +497,10 @@ def list_secrets( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ClientSecretContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract or + :return: AuthorizationServerSecretsContract or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.apimanagement.models.AuthorizationServerSecretsContract or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -521,12 +536,17 @@ def list_secrets( if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ClientSecretContract', response) + deserialized = self._deserialize('AuthorizationServerSecretsContract', response) + header_dict = { + 'ETag': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized 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 e871231af783..9be09d913a31 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 @@ -24,7 +24,7 @@ class BackendOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,14 +46,14 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| url | filter | - ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -
+ startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| url | filter | ge, + le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
:type filter: str :param top: Number of records to return. :type top: int @@ -365,8 +365,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: BackendContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.BackendContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -386,6 +387,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -402,12 +404,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('BackendContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} def delete( 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 3f0926176117..e81675782d16 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 @@ -24,7 +24,7 @@ class CacheOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -356,8 +356,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: CacheContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.CacheContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -377,6 +378,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -393,12 +395,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CacheContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} def delete( 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 ab5870bb7998..a500de2c020b 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 @@ -24,7 +24,7 @@ class CertificateOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,12 +34,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config def list_by_service( - self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, filter=None, top=None, skip=None, is_key_vault_refresh_failed=None, custom_headers=None, raw=False, **operation_config): """Lists a collection of all certificates in the specified service instance. @@ -47,20 +47,23 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| subject | filter | ge, le, eq, ne, gt, - lt | substringof, contains, startswith, endswith |
| thumbprint | + startswith, endswith |
| subject | filter | ge, le, eq, ne, gt, lt + | substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | - |
+ endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | + |
:type filter: str :param top: Number of records to return. :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 :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -91,6 +94,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("self.api_version", self.api_version, 'str') else: @@ -260,7 +265,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} def create_or_update( - self, resource_group_name, service_name, certificate_id, data, password, if_match=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, certificate_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): """Creates or updates the certificate being used for authentication with the backend. @@ -271,11 +276,9 @@ def create_or_update( :param certificate_id: Identifier of the certificate entity. Must be unique in the current API Management service instance. :type certificate_id: str - :param data: Base 64 encoded certificate using the - application/x-pkcs12 representation. - :type data: str - :param password: Password for the Certificate - :type password: str + :param parameters: Create or Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.CertificateCreateOrUpdateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. :type if_match: str @@ -290,8 +293,6 @@ def create_or_update( :raises: :class:`ErrorResponseException` """ - parameters = models.CertificateCreateOrUpdateParameters(data=data, password=password) - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -410,3 +411,73 @@ def delete( client_raw_response = ClientRawResponse(None, response) return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} + + def refresh_secret( + self, resource_group_name, service_name, certificate_id, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.refresh_secret.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CertificateContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret'} 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 new file mode 100644 index 000000000000..75b7f4475728 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py @@ -0,0 +1,389 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ContentItemOperations(object): + """ContentItemOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, content_type_id, custom_headers=None, raw=False, **operation_config): + """Returns list of content items. + + :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 content_type_id: Content type identifier. + :type content_type_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ContentItemContract + :rtype: + ~azure.mgmt.apimanagement.models.ContentItemContractPaged[~azure.mgmt.apimanagement.models.ContentItemContract] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ContentItemContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems'} + + def get_entity_tag( + self, resource_group_name, service_name, content_type_id, content_item_id, custom_headers=None, raw=False, **operation_config): + """Returns content item metadata. + + :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 content_type_id: Content type identifier. + :type content_type_id: str + :param content_item_id: Content item identifier. + :type content_item_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_id, 'str', max_length=80, min_length=1), + 'contentItemId': self._serialize.url("content_item_id", content_item_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} + + def get( + self, resource_group_name, service_name, content_type_id, content_item_id, custom_headers=None, raw=False, **operation_config): + """Returns content item 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 content_type_id: Content type identifier. + :type content_type_id: str + :param content_item_id: Content item identifier. + :type content_item_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ContentItemContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ContentItemContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_id, 'str', max_length=80, min_length=1), + 'contentItemId': self._serialize.url("content_item_id", content_item_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContentItemContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} + + def create_or_update( + self, resource_group_name, service_name, content_type_id, content_item_id, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates new content item. + + :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 content_type_id: Content type identifier. + :type content_type_id: str + :param content_item_id: Content item identifier. + :type content_item_id: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ContentItemContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ContentItemContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_id, 'str', max_length=80, min_length=1), + 'contentItemId': self._serialize.url("content_item_id", content_item_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContentItemContract', response) + header_dict = { + 'ETag': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('ContentItemContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} + + def delete( + self, resource_group_name, service_name, content_type_id, content_item_id, if_match, custom_headers=None, raw=False, **operation_config): + """Removes specified content item. + + :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 content_type_id: Content type identifier. + :type content_type_id: str + :param content_item_id: Content item identifier. + :type content_item_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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_id, 'str', max_length=80, min_length=1), + 'contentItemId': self._serialize.url("content_item_id", content_item_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} 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 new file mode 100644 index 000000000000..d6180f538910 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py @@ -0,0 +1,316 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class ContentTypeOperations(object): + """ContentTypeOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """Returns list of content types. + + :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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ContentTypeContract + :rtype: + ~azure.mgmt.apimanagement.models.ContentTypeContractPaged[~azure.mgmt.apimanagement.models.ContentTypeContract] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ContentTypeContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes'} + + def get( + self, resource_group_name, service_name, content_type_id, custom_headers=None, raw=False, **operation_config): + """Gets API Management content type 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 content_type_id: Content type identifier. + :type content_type_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ContentTypeContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ContentTypeContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContentTypeContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} + + def create_or_update( + self, resource_group_name, service_name, content_type_id, if_match=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates an Content Type. + + :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 content_type_id: Content type identifier. + :type content_type_id: str + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ContentTypeContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ContentTypeContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ContentTypeContract', response) + header_dict = { + 'ETag': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('ContentTypeContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} + + def delete( + self, resource_group_name, service_name, content_type_id, if_match, custom_headers=None, raw=False, **operation_config): + """Removes specified content type. + + :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 content_type_id: Content type identifier. + :type content_type_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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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])?$'), + 'contentTypeId': self._serialize.url("content_type_id", content_type_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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} 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 41ae87b61261..571cf2339a2d 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 @@ -24,7 +24,7 @@ class DelegationSettingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 new file mode 100644 index 000000000000..5435141d7dbb --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py @@ -0,0 +1,259 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeletedServicesOperations(object): + """DeletedServicesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Lists all soft-deleted services available for undelete for the given + subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedServiceContract + :rtype: + ~azure.mgmt.apimanagement.models.DeletedServiceContractPaged[~azure.mgmt.apimanagement.models.DeletedServiceContract] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeletedServiceContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices'} + + def get_by_name( + self, service_name, location, custom_headers=None, raw=False, **operation_config): + """Get soft-deleted Api Management Service by name. + + :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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedServiceContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.DeletedServiceContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_by_name.metadata['url'] + 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeletedServiceContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} + + + def _purge_initial( + self, service_name, location, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.purge.metadata['url'] + 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') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + + if response.status_code == 202: + deserialized = self._deserialize('DeletedServiceContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def purge( + self, service_name, location, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeletedServiceContract + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.DeletedServiceContract] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.DeletedServiceContract]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._purge_initial( + service_name=service_name, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeletedServiceContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} 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 e9d29894949a..757d3219a12c 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 @@ -24,7 +24,7 @@ class DiagnosticOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,11 +46,11 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -361,8 +361,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: DiagnosticContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -382,6 +383,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -398,12 +400,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DiagnosticContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} def delete( 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 aee6bc1b4943..181ee1121d02 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 @@ -24,7 +24,7 @@ class EmailTemplateOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,23 +34,23 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config def list_by_service( self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): - """Lists a collection of properties defined within a service instance. + """Gets all email templates. :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: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -366,8 +366,8 @@ def create_or_update( create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} def update( - self, resource_group_name, service_name, template_name, parameters, if_match, custom_headers=None, raw=False, **operation_config): - """Updates the specific Email Template. + self, resource_group_name, service_name, template_name, if_match, parameters, custom_headers=None, raw=False, **operation_config): + """Updates API Management email template. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -387,20 +387,21 @@ def update( 'requestDeveloperNotificationMessage' :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName - :param parameters: Update parameters. - :type parameters: - ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters :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: Update parameters. + :type parameters: + ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: EmailTemplateContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -420,6 +421,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -436,12 +438,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('EmailTemplateContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} def delete( 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 a26b4fe76387..69e63bc011db 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 @@ -24,7 +24,7 @@ class GatewayApiOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,12 +34,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config def list_by_service( - self, resource_group_name, service_name, gateway_id, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, gateway_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): """Lists a collection of the APIs associated with a gateway. :param resource_group_name: The name of the resource group. @@ -49,6 +49,12 @@ def list_by_service( :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 | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith |
+ :type filter: str :param top: Number of records to return. :type top: int :param skip: Number of records to skip. @@ -78,6 +84,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + 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: 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..7faae1d9b124 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py @@ -0,0 +1,429 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class GatewayCertificateAuthorityOperations(object): + """GatewayCertificateAuthorityOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, gateway_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + GatewayCertificateAuthorityContract + :rtype: + ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContractPaged[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + 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 = {} + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GatewayCertificateAuthorityContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities'} + + def get_entity_tag( + self, resource_group_name, service_name, gateway_id, certificate_id, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} + + def get( + self, resource_group_name, service_name, gateway_id, certificate_id, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GatewayCertificateAuthorityContract or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GatewayCertificateAuthorityContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} + + def create_or_update( + self, resource_group_name, service_name, gateway_id, certificate_id, if_match=None, is_trusted=None, custom_headers=None, raw=False, **operation_config): + """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 if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str + :param is_trusted: Determines whether certificate authority is + trusted. + :type is_trusted: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: GatewayCertificateAuthorityContract or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract + or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + parameters = models.GatewayCertificateAuthorityContract(is_trusted=is_trusted) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'GatewayCertificateAuthorityContract') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GatewayCertificateAuthorityContract', response) + header_dict = { + 'ETag': 'str', + } + if response.status_code == 201: + deserialized = self._deserialize('GatewayCertificateAuthorityContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} + + def delete( + self, resource_group_name, service_name, gateway_id, certificate_id, if_match, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.delete.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} 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 8f7ac6aecb3f..ec64b532fbec 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 @@ -24,7 +24,7 @@ class GatewayHostnameConfigurationOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,12 +34,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config def list_by_service( - self, resource_group_name, service_name, gateway_id, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, gateway_id, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): """Lists the collection of hostname configurations for the specified gateway. @@ -50,6 +50,13 @@ def list_by_service( :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 | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith |
| hostname | filter | ge, le, eq, ne, gt, + lt | substringof, contains, startswith, endswith |
+ :type filter: str :param top: Number of records to return. :type top: int :param skip: Number of records to skip. @@ -80,6 +87,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + 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: @@ -189,8 +198,7 @@ def get_entity_tag( def get( self, resource_group_name, service_name, gateway_id, hc_id, custom_headers=None, raw=False, **operation_config): - """Gets the details of the Gateway hostname configuration specified by its - identifier. + """Get details of a hostname configuration. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -264,7 +272,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} def create_or_update( - self, resource_group_name, service_name, gateway_id, hc_id, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, gateway_id, hc_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): """Creates of updates hostname configuration for a Gateway. :param resource_group_name: The name of the resource group. @@ -280,6 +288,9 @@ def create_or_update( :param parameters: :type parameters: ~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationContract + :param if_match: ETag of the Entity. Not required when creating an + entity, but required when updating an entity. + :type if_match: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -316,6 +327,8 @@ def create_or_update( header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) + if if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') @@ -351,7 +364,7 @@ def create_or_update( create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} def delete( - self, resource_group_name, service_name, gateway_id, hc_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, gateway_id, hc_id, if_match, custom_headers=None, raw=False, **operation_config): """Deletes the specified hostname configuration from the specified Gateway. @@ -365,6 +378,10 @@ def delete( :param hc_id: Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. :type hc_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 :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -396,6 +413,7 @@ def delete( header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') 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 40f29ec66b83..ff783d101731 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 @@ -24,7 +24,7 @@ class GatewayOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,18 +34,27 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config def list_by_service( - self, resource_group_name, service_name, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): """Lists a collection of gateways registered with 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 + :param filter: | Field | Usage | Supported + operators | Supported functions + |
|-------------|-------------|-------------|-------------|
| + name | filter | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith |
| region | filter | ge, le, eq, ne, gt, lt + | substringof, contains, startswith, endswith |
| description | + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith |
+ :type filter: str :param top: Number of records to return. :type top: int :param skip: Number of records to skip. @@ -74,6 +83,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + 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: @@ -361,8 +372,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: GatewayContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.GatewayContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -384,6 +396,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -400,12 +413,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GatewayContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} def delete( 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 e8c8e9496ed4..44c4bba5105c 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 @@ -24,7 +24,7 @@ class GroupOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,14 +46,14 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| aadObjectId | filter | eq | |
+ startswith, endswith |
| externalId | filter | eq | |
:type filter: str :param top: Number of records to return. :type top: int @@ -366,8 +366,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: GroupContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.GroupContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -387,6 +388,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -403,12 +405,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GroupContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} def delete( 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 abfb01cb5772..d3f41918a600 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 @@ -24,7 +24,7 @@ class GroupUserOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,18 +49,17 @@ def list( :param group_id: Group identifier. Must be unique in the current API Management service instance. :type group_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, - lt | substringof, contains, startswith, endswith |
| lastName | + startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, + lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| email | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| registrationDate - | filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, - le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -
+ endswith |
| email | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| registrationDate | + filter | ge, le, eq, ne, gt, lt | |
| note | filter | ge, le, + eq, ne, gt, lt | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 458ed98212a1..4b8143f28f22 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 @@ -24,7 +24,7 @@ class IdentityProviderOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -357,8 +357,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: IdentityProviderContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -378,6 +379,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -394,12 +396,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('IdentityProviderContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} def delete( @@ -520,12 +533,17 @@ def list_secrets( if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} deserialized = None if response.status_code == 200: deserialized = self._deserialize('ClientSecretContract', response) + header_dict = { + 'ETag': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized 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 505fff747273..8ff0bdfb2ea3 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 @@ -24,7 +24,7 @@ class IssueOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,17 +46,17 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| apiId | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| title | filter - | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith - |
| description | filter | ge, le, eq, ne, gt, lt | substringof, - contains, startswith, endswith |
| authorName | filter | ge, le, - eq, ne, gt, lt | substringof, contains, startswith, endswith |
| - state | filter | eq | |
+ startswith, endswith |
| apiId | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| title | filter | + ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
| description | filter | ge, le, eq, ne, gt, lt | substringof, + contains, startswith, endswith |
| authorName | filter | ge, le, + eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + state | filter | eq | |
:type filter: str :param top: Number of records to return. :type top: int 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 92dea27d29d3..a0fe6a083a1d 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 @@ -24,7 +24,7 @@ class LoggerOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,14 +46,14 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| description | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| - loggerType | filter | eq | |
| resourceId | filter | ge, le, - eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ startswith, endswith |
| description | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| + loggerType | filter | eq | |
| resourceId | filter | ge, le, + eq, ne, gt, lt | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -365,8 +365,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: LoggerContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -386,6 +387,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -402,16 +404,27 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LoggerContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} def delete( - self, resource_group_name, service_name, logger_id, if_match, force=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, logger_id, if_match, custom_headers=None, raw=False, **operation_config): """Deletes the specified logger. :param resource_group_name: The name of the resource group. @@ -425,8 +438,6 @@ def delete( entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str - :param force: Force deletion even if diagnostic is attached. - :type force: bool :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -449,8 +460,6 @@ def delete( # Construct parameters query_parameters = {} - if force is not None: - query_parameters['force'] = self._serialize.query("force", force, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers 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 7cc52f6fb5aa..1ecde4e4b8d5 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 @@ -26,7 +26,7 @@ class NamedValueOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -36,29 +36,32 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config def list_by_service( - self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): - """Lists a collection of NamedValues defined within a service instance. + self, resource_group_name, service_name, filter=None, top=None, skip=None, is_key_vault_refresh_failed=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of named values 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 - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| tags | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith, any, all |
| displayName | filter | ge, le, - eq, ne, gt, lt | substringof, contains, startswith, endswith |
+ startswith, endswith, any, all |
| displayName | filter | ge, le, + eq, ne, gt, lt | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :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 :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -89,6 +92,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("self.api_version", self.api_version, 'str') else: @@ -130,8 +135,8 @@ def internal_paging(next_link=None): def get_entity_tag( self, resource_group_name, service_name, named_value_id, custom_headers=None, raw=False, **operation_config): - """Gets the entity state (Etag) version of the NamedValue specified by its - identifier. + """Gets the entity state (Etag) version of the named value specified by + its identifier. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -189,7 +194,7 @@ def get_entity_tag( def get( self, resource_group_name, service_name, named_value_id, custom_headers=None, raw=False, **operation_config): - """Gets the details of the NamedValue specified by its identifier. + """Gets the details of the named value specified by its identifier. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -318,7 +323,7 @@ def _create_or_update_initial( def create_or_update( self, resource_group_name, service_name, named_value_id, parameters, if_match=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updates a NamedValue. + """Creates or updates named value. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -415,7 +420,7 @@ def _update_initial( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 202, 204]: + if response.status_code not in [200, 202]: raise models.ErrorResponseException(self._deserialize, response) deserialized = None @@ -436,7 +441,7 @@ def _update_initial( def update( self, resource_group_name, service_name, named_value_id, parameters, if_match, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates the specific NamedValue. + """Updates the specific named value. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -500,7 +505,7 @@ def get_long_running_output(response): def delete( self, resource_group_name, service_name, named_value_id, if_match, custom_headers=None, raw=False, **operation_config): - """Deletes specific NamedValue from the API Management service instance. + """Deletes specific named value from the API Management service instance. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -560,7 +565,7 @@ def delete( def list_value( self, resource_group_name, service_name, named_value_id, custom_headers=None, raw=False, **operation_config): - """Gets the secret value of the NamedValue. + """Gets 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 @@ -573,8 +578,8 @@ def list_value( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: PropertyValueContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.apimanagement.models.PropertyValueContract or + :return: NamedValueSecretContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.NamedValueSecretContract or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -610,13 +615,123 @@ def list_value( if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} deserialized = None if response.status_code == 200: - deserialized = self._deserialize('PropertyValueContract', response) + deserialized = self._deserialize('NamedValueSecretContract', response) + header_dict = { + 'ETag': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized list_value.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue'} + + + def _refresh_secret_initial( + self, resource_group_name, service_name, named_value_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.refresh_secret.metadata['url'] + 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, 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('NamedValueContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def refresh_secret( + self, resource_group_name, service_name, named_value_id, custom_headers=None, raw=False, polling=True, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns NamedValueContract or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.NamedValueContract] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.NamedValueContract]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._refresh_secret_initial( + resource_group_name=resource_group_name, + service_name=service_name, + named_value_id=named_value_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'ETag': 'str', + } + deserialized = self._deserialize('NamedValueContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} 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 1d1470f7a5ce..ccd8cd253cea 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 @@ -24,7 +24,7 @@ class NetworkStatusOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 7642c25b90f7..3590a8ff20e4 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 @@ -24,7 +24,7 @@ class NotificationOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 0010945f33a9..30c93602425a 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 @@ -24,7 +24,7 @@ class NotificationRecipientEmailOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 584a10409e5f..83abe8490001 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 @@ -24,7 +24,7 @@ class NotificationRecipientUserOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 8f2b7565010d..083b712ad896 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 @@ -24,7 +24,7 @@ class OpenIdConnectProviderOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,12 +46,12 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
+ startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -187,7 +187,7 @@ def get_entity_tag( def get( self, resource_group_name, service_name, opid, custom_headers=None, raw=False, **operation_config): - """Gets specific OpenID Connect Provider. + """Gets specific OpenID Connect Provider without secrets. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -362,8 +362,10 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: OpenidConnectProviderContract or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract + or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -383,6 +385,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -399,12 +402,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OpenidConnectProviderContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} def delete( @@ -520,12 +534,17 @@ def list_secrets( if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} deserialized = None if response.status_code == 200: deserialized = self._deserialize('ClientSecretContract', response) + header_dict = { + 'ETag': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized 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 20c50ea27494..649fc96b0cb5 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class OperationOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -51,18 +50,18 @@ def list_by_tags( API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| apiName - | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| description | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| method | filter | - ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, - contains, startswith, endswith |
+ startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| apiName | + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith |
| description | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| method | filter | + ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, + contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -78,7 +77,8 @@ def list_by_tags( :return: An iterator like instance of TagResourceContract :rtype: ~azure.mgmt.apimanagement.models.TagResourceContractPaged[~azure.mgmt.apimanagement.models.TagResourceContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -128,9 +128,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return 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 9dd71e8a269c..86d942c84063 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 @@ -24,7 +24,7 @@ class PolicyDescriptionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 3a64140c6a9f..7589ef4765e6 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 @@ -24,7 +24,7 @@ class PolicyOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". :ivar policy_id: The identifier of the Policy. Constant value: "policy". """ @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.policy_id = "policy" self.config = config 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 new file mode 100644 index 000000000000..74ecd1969057 --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py @@ -0,0 +1,502 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class PortalRevisionOperations(object): + """PortalRevisionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, top=None, skip=None, custom_headers=None, raw=False, **operation_config): + """Lists a collection of developer portal revision entities. + + :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: | Field | Supported operators | Supported + functions | + |-------------|------------------------|-----------------------------------| + |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith| + |description | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith| + |isCurrent | 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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of PortalRevisionContract + :rtype: + ~azure.mgmt.apimanagement.models.PortalRevisionContractPaged[~azure.mgmt.apimanagement.models.PortalRevisionContract] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + 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 = {} + 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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PortalRevisionContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions'} + + def get_entity_tag( + self, resource_group_name, service_name, portal_revision_id, custom_headers=None, raw=False, **operation_config): + """Gets developer portal revision 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 portal_revision_id: Portal revision identifier. Must be unique + in the current API Management service instance. + :type portal_revision_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get_entity_tag.metadata['url'] + 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])?$'), + 'portalRevisionId': self._serialize.url("portal_revision_id", portal_revision_id, 'str', max_length=256, 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.head(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + client_raw_response.add_headers({ + 'ETag': 'str', + }) + return client_raw_response + get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} + + def get( + self, resource_group_name, service_name, portal_revision_id, custom_headers=None, raw=False, **operation_config): + """Gets developer portal revision 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 portal_revision_id: Portal revision identifier. Must be unique + in the current API Management service instance. + :type portal_revision_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalRevisionContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalRevisionContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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])?$'), + 'portalRevisionId': self._serialize.url("portal_revision_id", portal_revision_id, 'str', max_length=256, 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PortalRevisionContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} + + + def _create_or_update_initial( + self, resource_group_name, service_name, portal_revision_id, description=None, is_current=None, custom_headers=None, raw=False, **operation_config): + parameters = models.PortalRevisionContract(description=description, is_current=is_current) + + # Construct URL + url = self.create_or_update.metadata['url'] + 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])?$'), + 'portalRevisionId': self._serialize.url("portal_revision_id", portal_revision_id, 'str', max_length=256, 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalRevisionContract') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [201, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 201: + deserialized = self._deserialize('PortalRevisionContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, service_name, portal_revision_id, description=None, is_current=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new developer portal revision. + + :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 portal_revision_id: Portal revision identifier. Must be unique + in the current API Management service instance. + :type portal_revision_id: str + :param description: Portal revision description. + :type description: str + :param is_current: Indicates if the Portal Revision is public. + :type is_current: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PortalRevisionContract + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.PortalRevisionContract] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.PortalRevisionContract]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + portal_revision_id=portal_revision_id, + description=description, + is_current=is_current, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'ETag': 'str', + } + deserialized = self._deserialize('PortalRevisionContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} + + + def _update_initial( + self, resource_group_name, service_name, portal_revision_id, if_match, description=None, is_current=None, custom_headers=None, raw=False, **operation_config): + parameters = models.PortalRevisionContract(description=description, is_current=is_current) + + # Construct URL + url = self.update.metadata['url'] + 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])?$'), + 'portalRevisionId': self._serialize.url("portal_revision_id", portal_revision_id, 'str', max_length=256, 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'PortalRevisionContract') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + header_dict = {} + + if response.status_code == 200: + deserialized = self._deserialize('PortalRevisionContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, service_name, portal_revision_id, if_match, description=None, is_current=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the description of specified portal revision or makes it + current. + + :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 portal_revision_id: Portal revision identifier. Must be unique + in the current API Management service instance. + :type portal_revision_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 + :param description: Portal revision description. + :type description: str + :param is_current: Indicates if the Portal Revision is public. + :type is_current: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns PortalRevisionContract + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.apimanagement.models.PortalRevisionContract] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.apimanagement.models.PortalRevisionContract]] + :raises: + :class:`ErrorResponseException` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + service_name=service_name, + portal_revision_id=portal_revision_id, + if_match=if_match, + description=description, + is_current=is_current, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + header_dict = { + 'ETag': 'str', + } + deserialized = self._deserialize('PortalRevisionContract', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} 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..84c9e31551ac --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class PortalSettingsOperations(object): + """PortalSettingsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: PortalSettingsCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.PortalSettingsCollection or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.list_by_service.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('PortalSettingsCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings'} 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 2e8b6c46c519..e5f0834f10f4 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 @@ -24,7 +24,7 @@ class ProductApiOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,17 +49,17 @@ def list_by_product( :param product_id: Product identifier. Must be unique in the current API Management service instance. :type product_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| path | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
+ startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, + lt | substringof, contains, startswith, endswith |
| path | filter + | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
:type filter: str :param top: Number of records to return. :type top: int 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 da974b742fac..a2aa0c6effaa 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 @@ -24,7 +24,7 @@ class ProductGroupOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -50,12 +50,12 @@ def list_by_product( :param product_id: Product identifier. Must be unique in the current API Management service instance. :type product_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| - name | filter | ge, le, eq, ne, gt, lt | |
| displayName | - filter | eq, ne | |
| description | filter | eq, ne | | -
+ name | filter | ge, le, eq, ne, gt, lt | |
| displayName | + filter | eq, ne | |
| description | filter | eq, ne | + |
:type filter: str :param top: Number of records to return. :type top: int 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 4f46d390296f..645ae2476b73 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 @@ -24,7 +24,7 @@ class ProductOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,16 +46,16 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| state | filter - | eq | |
| groups | expand | | |
+ startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| state | filter | + eq | |
| groups | expand | | |
:type filter: str :param top: Number of records to return. :type top: int @@ -376,8 +376,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: ProductContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.ProductContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -397,6 +398,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -413,12 +415,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ProductContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} def delete( @@ -495,16 +508,16 @@ def list_by_tags( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| state | filter - | eq | substringof, contains, startswith, endswith |
+ startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| state | filter | + eq | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 c1092714069e..aa7ecea90d26 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 @@ -24,7 +24,7 @@ class ProductPolicyOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". :ivar policy_id: The identifier of the Policy. Constant value: "policy". """ @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.policy_id = "policy" self.config = config 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 9a6079a07e70..5bf97000b2ec 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 @@ -24,7 +24,7 @@ class ProductSubscriptionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,21 +49,21 @@ def list( :param product_id: Product identifier. Must be unique in the current API Management service instance. :type product_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, - contains, startswith, endswith |
| ownerId | filter | ge, le, eq, - ne, gt, lt | substringof, contains, startswith, endswith |
| - scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| productId | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| state | filter | eq | |
| user | expand | - | |
+ contains, startswith, endswith |
| ownerId | filter | ge, le, eq, + ne, gt, lt | substringof, contains, startswith, endswith |
| scope + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith |
| userId | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| productId | filter + | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
| state | filter | eq | |
| user | expand | | + |
:type filter: str :param top: Number of records to return. :type top: int 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 0d4220b0cfd6..eccfe0e3aa08 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 @@ -24,7 +24,7 @@ class QuotaByCounterKeysOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -134,12 +134,13 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: QuotaCounterCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterCollection or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred) + parameters = models.QuotaCounterValueUpdateContract(calls_count=calls_count, kb_transferred=kb_transferred) # Construct URL url = self.update.metadata['url'] @@ -157,6 +158,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -166,16 +168,22 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties') + body_content = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('QuotaCounterCollection', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'} 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 db29c87e0c04..07c67969d4b4 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 @@ -24,7 +24,7 @@ class QuotaByPeriodKeysOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -137,12 +137,13 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: QuotaCounterContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ - parameters = models.QuotaCounterValueContractProperties(calls_count=calls_count, kb_transferred=kb_transferred) + parameters = models.QuotaCounterValueUpdateContract(calls_count=calls_count, kb_transferred=kb_transferred) # Construct URL url = self.update.metadata['url'] @@ -161,6 +162,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -170,16 +172,22 @@ def update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'QuotaCounterValueContractProperties') + body_content = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') # Construct and send request request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('QuotaCounterContract', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'} 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 e2c5b8b6b2ef..0337c832ba36 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 @@ -24,7 +24,7 @@ class RegionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 ce71756ffbd8..4f2033c7af8a 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -25,7 +24,7 @@ class ReportsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -35,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -63,7 +62,8 @@ def list_by_api( :return: An iterator like instance of ReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -111,9 +111,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -168,7 +166,8 @@ def list_by_user( :return: An iterator like instance of ReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -216,9 +215,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -273,7 +270,8 @@ def list_by_operation( :return: An iterator like instance of ReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -321,9 +319,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -376,7 +372,8 @@ def list_by_product( :return: An iterator like instance of ReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -424,9 +421,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -477,7 +472,8 @@ def list_by_geo( :return: An iterator like instance of ReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -523,9 +519,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -579,7 +573,8 @@ def list_by_subscription( :return: An iterator like instance of ReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -627,9 +622,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -688,7 +681,8 @@ def list_by_time( :return: An iterator like instance of ReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.ReportRecordContractPaged[~azure.mgmt.apimanagement.models.ReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -737,9 +731,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return response @@ -780,7 +772,8 @@ def list_by_request( :return: An iterator like instance of RequestReportRecordContract :rtype: ~azure.mgmt.apimanagement.models.RequestReportRecordContractPaged[~azure.mgmt.apimanagement.models.RequestReportRecordContract] - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ def prepare_request(next_link=None): if not next_link: @@ -826,9 +819,7 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) return 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 515301379741..93d21605f0c2 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 @@ -24,7 +24,7 @@ class SignInSettingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 01e8bd6c0d9d..2bd4516d8786 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 @@ -24,7 +24,7 @@ class SignUpSettingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 c6dbaa892536..9e98d64bb7c6 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 @@ -24,7 +24,7 @@ class SubscriptionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,21 +46,21 @@ def list( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | substringof, - contains, startswith, endswith |
| ownerId | filter | ge, le, eq, - ne, gt, lt | substringof, contains, startswith, endswith |
| - scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| productId | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| state | filter | eq | |
| user | expand | - | |
+ contains, startswith, endswith |
| ownerId | filter | ge, le, eq, + ne, gt, lt | substringof, contains, startswith, endswith |
| scope + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith |
| userId | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| productId | filter + | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
| state | filter | eq | |
| user | expand | | + |
:type filter: str :param top: Number of records to return. :type top: int @@ -265,7 +265,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} def create_or_update( - self, resource_group_name, service_name, sid, parameters, notify=None, if_match=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, sid, parameters, notify=None, if_match=None, app_type="portal", custom_headers=None, raw=False, **operation_config): """Creates or updates the subscription of specified user to the specified product. @@ -287,6 +287,10 @@ def create_or_update( :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. :type if_match: str + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -313,6 +317,8 @@ def create_or_update( if notify is not None: query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} @@ -359,7 +365,7 @@ def create_or_update( create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} def update( - self, resource_group_name, service_name, sid, parameters, if_match, notify=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, sid, parameters, if_match, notify=None, app_type="portal", custom_headers=None, raw=False, **operation_config): """Updates the details of a subscription specified by its identifier. :param resource_group_name: The name of the resource group. @@ -381,13 +387,18 @@ def update( subscription - If true, send email notification of change of state of subscription :type notify: bool + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: SubscriptionContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -406,9 +417,12 @@ def update( if notify is not None: query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -425,12 +439,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubscriptionContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} def delete( @@ -610,7 +635,7 @@ def regenerate_secondary_key( def list_secrets( self, resource_group_name, service_name, sid, custom_headers=None, raw=False, **operation_config): - """Gets the subscription keys. + """Gets the specified Subscription keys. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -661,12 +686,17 @@ def list_secrets( if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} deserialized = None if response.status_code == 200: deserialized = self._deserialize('SubscriptionKeysContract', response) + header_dict = { + 'ETag': 'str', + } if raw: client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response return deserialized 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 fcae3c76c755..178e2f0aa5dd 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 @@ -24,7 +24,7 @@ class TagOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -53,12 +53,12 @@ def list_by_operation( :param operation_id: Operation identifier within an API. Must be unique in the current API Management service instance. :type operation_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
+ startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -433,12 +433,12 @@ def list_by_api( API Management service instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
+ startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -803,12 +803,12 @@ def list_by_product( :param product_id: Product identifier. Must be unique in the current API Management service instance. :type product_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
+ startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -1158,12 +1158,12 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
+ startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -1479,8 +1479,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: TagContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TagContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -1502,6 +1503,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -1518,12 +1520,23 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TagContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} def delete( 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 968cfec99052..63ff0b2dda23 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 @@ -24,7 +24,7 @@ class TagResourceOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -46,27 +46,26 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| aid | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| displayName | + startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| apiRevision | + endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| path | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| description | + endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, + contains, startswith, endswith |
| description | filter | ge, le, + eq, ne, gt, lt | substringof, contains, startswith, endswith |
| + serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, + startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt + | substringof, contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| method | filter | - ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, - contains, startswith, endswith |
| terms | filter | ge, le, eq, - ne, gt, lt | substringof, contains, startswith, endswith |
| - state | filter | eq | |
| isCurrent | filter | eq | | -
+ endswith |
| terms | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| state | filter | + eq | |
| isCurrent | filter | eq | |
:type filter: str :param top: Number of records to return. :type top: int 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 56879020577a..8bb3ed4e9496 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 @@ -24,8 +24,7 @@ class TenantAccessGitOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". - :ivar access_name: The identifier of the Access configuration. Constant value: "access". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -35,85 +34,22 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" - self.access_name = "access" + self.api_version = "2021-01-01-preview" self.config = config - def get( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): - """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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessInformationContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.get.metadata['url'] - 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("self.access_name", self.access_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - header_dict = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AccessInformationContract', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git'} - def regenerate_primary_key( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, custom_headers=None, raw=False, **operation_config): """Regenerate primary access key for GIT. :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. + Possible values include: 'access', 'gitAccess' + :type access_name: str or + ~azure.mgmt.apimanagement.models.AccessIdName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -130,7 +66,7 @@ def regenerate_primary_key( '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("self.access_name", self.access_name, 'str') + 'accessName': self._serialize.url("access_name", access_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -160,13 +96,17 @@ def regenerate_primary_key( regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey'} def regenerate_secondary_key( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, custom_headers=None, raw=False, **operation_config): """Regenerate secondary access key for GIT. :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. + Possible values include: 'access', 'gitAccess' + :type access_name: str or + ~azure.mgmt.apimanagement.models.AccessIdName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -183,7 +123,7 @@ def regenerate_secondary_key( '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("self.access_name", self.access_name, 'str') + 'accessName': self._serialize.url("access_name", access_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -211,69 +151,3 @@ def regenerate_secondary_key( client_raw_response = ClientRawResponse(None, response) return client_raw_response regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'} - - def list_secrets( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): - """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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: AccessInformationContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorResponseException` - """ - # Construct URL - url = self.list_secrets.metadata['url'] - 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("self.access_name", self.access_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.ErrorResponseException(self._deserialize, response) - - header_dict = {} - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('AccessInformationContract', response) - header_dict = { - 'ETag': 'str', - } - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - client_raw_response.add_headers(header_dict) - return client_raw_response - - return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/listSecrets'} 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 ac6665edb7de..36e7b65e5dfd 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 @@ -24,8 +24,7 @@ class TenantAccessOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". - :ivar access_name: The identifier of the Access configuration. Constant value: "access". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -35,19 +34,97 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" - self.access_name = "access" + self.api_version = "2021-01-01-preview" self.config = config + def list_by_service( + self, resource_group_name, service_name, filter=None, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AccessInformationContract + :rtype: + ~azure.mgmt.apimanagement.models.AccessInformationContractPaged[~azure.mgmt.apimanagement.models.AccessInformationContract] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + 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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.AccessInformationContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant'} + def get_entity_tag( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, custom_headers=None, raw=False, **operation_config): """Tenant access metadata. :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. + Possible values include: 'access', 'gitAccess' + :type access_name: str or + ~azure.mgmt.apimanagement.models.AccessIdName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -64,7 +141,7 @@ def get_entity_tag( '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("self.access_name", self.access_name, 'str') + 'accessName': self._serialize.url("access_name", access_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -97,13 +174,17 @@ def get_entity_tag( get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} def get( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, custom_headers=None, raw=False, **operation_config): """Get tenant access information details 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. + Possible values include: 'access', 'gitAccess' + :type access_name: str or + ~azure.mgmt.apimanagement.models.AccessIdName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -121,7 +202,7 @@ def get( '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("self.access_name", self.access_name, 'str') + 'accessName': self._serialize.url("access_name", access_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -162,14 +243,101 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} + def create( + self, resource_group_name, service_name, parameters, access_name, if_match, custom_headers=None, raw=False, **operation_config): + """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 parameters: Parameters supplied to retrieve the Tenant Access + Information. + :type parameters: + ~azure.mgmt.apimanagement.models.AccessInformationCreateParameters + :param access_name: The identifier of the Access configuration. + Possible values include: 'access', 'gitAccess' + :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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AccessInformationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.create.metadata['url'] + 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AccessInformationCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessInformationContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} + def update( - self, resource_group_name, service_name, if_match, enabled=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, if_match, enabled=None, custom_headers=None, raw=False, **operation_config): """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. + Possible values include: 'access', 'gitAccess' + :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. @@ -181,8 +349,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: AccessInformationContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -193,7 +362,7 @@ def update( 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("self.access_name", self.access_name, 'str'), + '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) @@ -204,6 +373,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -220,22 +390,37 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('AccessInformationContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} def regenerate_primary_key( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, custom_headers=None, raw=False, **operation_config): """Regenerate primary access key. :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. + Possible values include: 'access', 'gitAccess' + :type access_name: str or + ~azure.mgmt.apimanagement.models.AccessIdName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -252,7 +437,7 @@ def regenerate_primary_key( '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("self.access_name", self.access_name, 'str') + 'accessName': self._serialize.url("access_name", access_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -282,13 +467,17 @@ def regenerate_primary_key( regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey'} def regenerate_secondary_key( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, custom_headers=None, raw=False, **operation_config): """Regenerate secondary access key. :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. + Possible values include: 'access', 'gitAccess' + :type access_name: str or + ~azure.mgmt.apimanagement.models.AccessIdName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -305,7 +494,7 @@ def regenerate_secondary_key( '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("self.access_name", self.access_name, 'str') + 'accessName': self._serialize.url("access_name", access_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -335,20 +524,26 @@ def regenerate_secondary_key( regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey'} def list_secrets( - self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, access_name, custom_headers=None, raw=False, **operation_config): """Get 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. + Possible values include: 'access', 'gitAccess' + :type access_name: str or + ~azure.mgmt.apimanagement.models.AccessIdName :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: AccessInformationContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract or + :return: AccessInformationSecretsContract or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.apimanagement.models.AccessInformationSecretsContract or ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` @@ -359,7 +554,7 @@ def list_secrets( '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("self.access_name", self.access_name, 'str') + 'accessName': self._serialize.url("access_name", access_name, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -387,7 +582,7 @@ def list_secrets( header_dict = {} deserialized = None if response.status_code == 200: - deserialized = self._deserialize('AccessInformationContract', response) + deserialized = self._deserialize('AccessInformationSecretsContract', response) header_dict = { 'ETag': 'str', } 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 e08d0f7c5e8f..ac65dff1d5d8 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 @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -27,7 +26,7 @@ class TenantConfigurationOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". :ivar configuration_name: The identifier of the Git Configuration Operation. Constant value: "configuration". """ @@ -38,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.configuration_name = "configuration" self.config = config @@ -389,7 +388,8 @@ def get_sync_state( :rtype: ~azure.mgmt.apimanagement.models.TenantConfigurationSyncStateContract or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorResponseException` """ # Construct URL url = self.get_sync_state.metadata['url'] @@ -420,9 +420,7 @@ def get_sync_state( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: 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..cc5bc43e98af --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_settings_operations.py @@ -0,0 +1,182 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .. import models + + +class TenantSettingsOperations(object): + """TenantSettingsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". + :ivar settings_type: The identifier of the settings. Constant value: "public". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-01-01-preview" + self.settings_type = "public" + + self.config = config + + def list_by_service( + self, resource_group_name, service_name, filter=None, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TenantSettingsContract + :rtype: + ~azure.mgmt.apimanagement.models.TenantSettingsContractPaged[~azure.mgmt.apimanagement.models.TenantSettingsContract] + :raises: + :class:`ErrorResponseException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_service.metadata['url'] + 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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TenantSettingsContractPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings'} + + def get( + self, resource_group_name, service_name, custom_headers=None, raw=False, **operation_config): + """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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TenantSettingsContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.TenantSettingsContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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("self.settings_type", self.settings_type, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TenantSettingsContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}'} 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 193c9b412fe3..7cbc321fa13b 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 @@ -24,7 +24,7 @@ class UserConfirmationPasswordOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,12 +34,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config def send( - self, resource_group_name, service_name, user_id, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, user_id, app_type="portal", custom_headers=None, raw=False, **operation_config): """Sends confirmation. :param resource_group_name: The name of the resource group. @@ -49,6 +49,10 @@ def send( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -72,6 +76,8 @@ def send( # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} 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 947c714ca66f..10ca98439ee8 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 @@ -24,7 +24,7 @@ class UserGroupOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,14 +49,14 @@ def list( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions - |
|-------------|-------------|-------------|-------------|
| + :param filter: | Field | Usage | Supported + operators | Supported functions + |
|-------------|------------------------|-----------------------------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| + startswith, endswith |
| displayName | filter | ge, le, eq, ne, + gt, lt | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
+ startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int 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 ac5de590d1b6..4d624efd1230 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 @@ -24,7 +24,7 @@ class UserIdentitiesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config 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 2fd37c3c6203..561db9acddf3 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 @@ -24,7 +24,7 @@ class UserOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -47,19 +47,19 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param filter: | Field | Usage | Supported operators - | Supported functions + :param filter: | Field | Usage | Supported + operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, - lt | substringof, contains, startswith, endswith |
| lastName | + startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, + lt | substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
| email | filter | ge, le, eq, ne, gt, lt | - substringof, contains, startswith, endswith |
| state | filter | - eq | |
| registrationDate | filter | ge, le, eq, ne, gt, lt | - |
| note | filter | ge, le, eq, ne, gt, lt | substringof, - contains, startswith, endswith |
| groups | expand | | | -
+ endswith |
| email | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
| state | filter | + eq | |
| registrationDate | filter | ge, le, eq, ne, gt, lt | + |
| note | filter | ge, le, eq, ne, gt, lt | substringof, + contains, startswith, endswith |
| groups | expand | | + |
:type filter: str :param top: Number of records to return. :type top: int @@ -268,7 +268,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} def create_or_update( - self, resource_group_name, service_name, user_id, parameters, if_match=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, user_id, parameters, notify=None, if_match=None, custom_headers=None, raw=False, **operation_config): """Creates or Updates a user. :param resource_group_name: The name of the resource group. @@ -281,6 +281,8 @@ def create_or_update( :param parameters: Create or update parameters. :type parameters: ~azure.mgmt.apimanagement.models.UserCreateParameters + :param notify: Send an Email notification to the User. + :type notify: bool :param if_match: ETag of the Entity. Not required when creating an entity, but required when updating an entity. :type if_match: str @@ -307,6 +309,8 @@ def create_or_update( # Construct parameters query_parameters = {} + if notify is not None: + query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -376,8 +380,9 @@ def update( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: UserContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.UserContract or + ~msrest.pipeline.ClientRawResponse :raises: :class:`ErrorResponseException` """ @@ -397,6 +402,7 @@ def update( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -413,16 +419,27 @@ def update( request = self._client.patch(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [204]: + if response.status_code not in [200]: raise models.ErrorResponseException(self._deserialize, response) + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UserContract', response) + header_dict = { + 'ETag': 'str', + } + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) return client_raw_response + + return deserialized update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} def delete( - self, resource_group_name, service_name, user_id, if_match, delete_subscriptions=None, notify=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, service_name, user_id, if_match, delete_subscriptions=None, notify=None, app_type="portal", custom_headers=None, raw=False, **operation_config): """Deletes specific user. :param resource_group_name: The name of the resource group. @@ -441,6 +458,10 @@ def delete( :type delete_subscriptions: bool :param notify: Send an Account Closed Email notification to the User. :type notify: bool + :param app_type: Determines the type of application which send the + create user request. Default is legacy publisher portal. Possible + values include: 'portal', 'developerPortal' + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -468,6 +489,8 @@ def delete( if notify is not None: query_parameters['notify'] = self._serialize.query("notify", notify, 'bool') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if app_type is not None: + query_parameters['appType'] = self._serialize.query("app_type", app_type, 'str') # Construct headers header_parameters = {} 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 cbf13b40c7e8..4dea49f2a487 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 @@ -24,7 +24,7 @@ class UserSubscriptionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Version of the API to be used with the client request. Constant value: "2019-12-01". + :ivar api_version: Version of the API to be used with the client request. Constant value: "2021-01-01-preview". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-12-01" + self.api_version = "2021-01-01-preview" self.config = config @@ -49,20 +49,19 @@ def list( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str - :param filter: | Field | Usage | Supported operators - | Supported functions - |
|-------------|-------------|-------------|-------------|
| - name | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| displayName | filter | ge, le, eq, ne, - gt, lt | substringof, contains, startswith, endswith |
| - stateComment | filter | ge, le, eq, ne, gt, lt | substringof, - contains, startswith, endswith |
| ownerId | filter | ge, le, eq, - ne, gt, lt | substringof, contains, startswith, endswith |
| - scope | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt - | substringof, contains, startswith, endswith |
| productId | + :param filter: | Field | Usage | Supported operators + | Supported functions + |
|-------------|------------------------|-----------------------------------|
|name + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, + endswith |
|displayName | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
|stateComment | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, - endswith |
+ endswith |
|ownerId | filter | ge, le, eq, ne, gt, lt | + substringof, contains, startswith, endswith |
|scope | filter | + ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith + |
|userId | filter | ge, le, eq, ne, gt, lt | substringof, + contains, startswith, endswith |
|productId | filter | ge, le, eq, + ne, gt, lt | substringof, contains, startswith, endswith |
:type filter: str :param top: Number of records to return. :type top: int @@ -137,3 +136,77 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions'} + + def get( + self, resource_group_name, service_name, user_id, sid, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SubscriptionContract or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` + """ + # Construct URL + url = self.get.metadata['url'] + 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, 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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.ErrorResponseException(self._deserialize, response) + + header_dict = {} + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('SubscriptionContract', response) + header_dict = { + 'ETag': 'str', + } + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response.add_headers(header_dict) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}'}