From d392c853a99e86e96a44edf3ef78215095c1cfa4 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 4 Feb 2021 02:50:16 +0000 Subject: [PATCH] CodeGen from PR 12659 in Azure/azure-rest-api-specs add query parameter to Namedvalue and Certificate (#12659) * add filter flag * rephrase Co-authored-by: Kacie Kang --- .../apimanagement/_api_management_client.py | 32 +- .../mgmt/apimanagement/models/__init__.py | 74 +- .../models/_api_management_client_enums.py | 47 +- .../mgmt/apimanagement/models/_models.py | 856 +++++++++++++++-- .../mgmt/apimanagement/models/_models_py3.py | 898 +++++++++++++++--- .../apimanagement/models/_paged_models.py | 78 ++ .../mgmt/apimanagement/operations/__init__.py | 12 + .../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 | 12 +- ..._api_management_service_skus_operations.py | 4 +- .../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 | 225 +++++ .../operations/_diagnostic_operations.py | 31 +- .../operations/_email_template_operations.py | 43 +- .../operations/_gateway_api_operations.py | 14 +- ...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 +- 77 files changed, 4879 insertions(+), 954 deletions(-) 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/_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 b7ddabddd99a6..ce5718b7eca43 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 @@ -54,6 +57,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 +71,7 @@ from .operations import QuotaByPeriodKeysOperations from .operations import RegionOperations from .operations import ReportsOperations +from .operations import TenantSettingsOperations from .operations import SubscriptionOperations from .operations import TagResourceOperations from .operations import TenantAccessOperations @@ -126,6 +132,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 @@ -168,6 +180,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 +208,8 @@ 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 subscription: Subscription operations :vartype subscription: azure.mgmt.apimanagement.operations.SubscriptionOperations :ivar tag_resource: TagResource operations @@ -232,7 +250,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 = '2020-06-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -276,6 +294,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( @@ -318,6 +342,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 +370,8 @@ 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.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 63f339e9d0f00..2e3282d1d257e 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,6 +11,8 @@ 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 ApiContract @@ -45,6 +47,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 +68,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 @@ -95,11 +103,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 +135,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 +145,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 +183,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,6 +198,8 @@ 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 ApiContract @@ -216,6 +234,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 +255,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 @@ -266,11 +290,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 +322,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 +332,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 +370,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,6 +383,7 @@ 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 ApiReleaseContractPaged @@ -360,6 +393,9 @@ 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 GatewayContractPaged @@ -375,6 +411,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 +422,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 +434,12 @@ SoapApiType, ApiType, State, + DataMaskingMode, SamplingType, AlwaysLog, HttpCorrelationProtocol, Verbosity, + OperationNameFormat, PolicyContentFormat, VersioningScheme, GrantType, @@ -422,8 +462,10 @@ IdentityProviderType, LoggerType, ConnectivityStatusType, + PortalRevisionStatus, SubscriptionState, AsyncOperationStatus, + AccessIdName, NotificationName, PolicyExportFormat, TemplateName, @@ -433,6 +475,8 @@ __all__ = [ 'AccessInformationContract', + 'AccessInformationCreateParameters', + 'AccessInformationSecretsContract', 'AccessInformationUpdateParameters', 'AdditionalLocation', 'ApiContract', @@ -467,6 +511,7 @@ 'AuthenticationSettingsContract', 'AuthorizationServerContract', 'AuthorizationServerContractBaseProperties', + 'AuthorizationServerSecretsContract', 'AuthorizationServerUpdateContract', 'BackendAuthorizationHeaderCredentials', 'BackendBaseParameters', @@ -487,6 +532,11 @@ 'CertificateInformation', 'ClientSecretContract', 'ConnectivityStatusContract', + 'ContentItemContract', + 'ContentTypeContract', + 'DataMasking', + 'DataMaskingEntity', + 'DeletedServiceContract', 'DeployConfigurationParameters', 'DiagnosticContract', 'EmailTemplateContract', @@ -517,11 +567,15 @@ 'IssueContract', 'IssueContractBaseProperties', 'IssueUpdateContract', + 'KeyVaultContractCreateProperties', + 'KeyVaultContractProperties', + 'KeyVaultLastAccessStatusContractProperties', 'LoggerContract', 'LoggerUpdateContract', 'NamedValueContract', 'NamedValueCreateContract', 'NamedValueEntityBaseParameters', + 'NamedValueSecretContract', 'NamedValueUpdateParameters', 'NetworkStatusContract', 'NetworkStatusContractByLocation', @@ -545,6 +599,9 @@ 'PolicyDescriptionCollection', 'PolicyDescriptionContract', 'PortalDelegationSettings', + 'PortalRevisionContract', + 'PortalSettingsCollection', + 'PortalSettingsContract', 'PortalSettingValidationKeyContract', 'PortalSigninSettings', 'PortalSignupSettings', @@ -552,11 +609,11 @@ 'ProductEntityBaseParameters', 'ProductTagResourceContractProperties', 'ProductUpdateParameters', - 'PropertyValueContract', 'QuotaCounterCollection', 'QuotaCounterContract', 'QuotaCounterValueContract', 'QuotaCounterValueContractProperties', + 'QuotaCounterValueUpdateContract', 'RecipientEmailCollection', 'RecipientEmailContract', 'RecipientsContractProperties', @@ -590,6 +647,7 @@ 'TagResourceContract', 'TagTagResourceContractProperties', 'TenantConfigurationSyncStateContract', + 'TenantSettingsContract', 'TermsOfServiceProperties', 'TokenBodyParameterContract', 'UserContract', @@ -620,6 +678,9 @@ 'BackendContractPaged', 'CacheContractPaged', 'CertificateContractPaged', + 'ContentTypeContractPaged', + 'ContentItemContractPaged', + 'DeletedServiceContractPaged', 'OperationPaged', 'ResourceSkuResultPaged', 'ApiManagementServiceResourcePaged', @@ -633,10 +694,13 @@ 'NamedValueContractPaged', 'NotificationContractPaged', 'OpenidConnectProviderContractPaged', + 'PortalRevisionContractPaged', 'SubscriptionContractPaged', 'RegionContractPaged', 'ReportRecordContractPaged', 'RequestReportRecordContractPaged', + 'TenantSettingsContractPaged', + 'AccessInformationContractPaged', 'UserIdentityContractPaged', 'ExportResultFormat', 'ProductState', @@ -646,10 +710,12 @@ 'SoapApiType', 'ApiType', 'State', + 'DataMaskingMode', 'SamplingType', 'AlwaysLog', 'HttpCorrelationProtocol', 'Verbosity', + 'OperationNameFormat', 'PolicyContentFormat', 'VersioningScheme', 'GrantType', @@ -672,8 +738,10 @@ 'IdentityProviderType', 'LoggerType', 'ConnectivityStatusType', + 'PortalRevisionStatus', 'SubscriptionState', '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 6c2944f5bc971..25d93931dc37c 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 @@ -42,14 +42,14 @@ 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): @@ -73,6 +73,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 +103,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 +169,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): @@ -210,6 +223,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 +262,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 +272,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" @@ -275,6 +298,12 @@ class AsyncOperationStatus(str, Enum): failed = "Failed" +class AccessIdName(str, Enum): + + access = "access" + get_access = "getAccess" + + 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 +350,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 3e016257f412f..2776ef92b5d6a 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,14 +185,17 @@ 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 virtual_network_configuration: Virtual network configuration for the location. @@ -107,6 +221,7 @@ 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]'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, @@ -118,6 +233,7 @@ 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.virtual_network_configuration = kwargs.get('virtual_network_configuration', None) @@ -125,39 +241,6 @@ def __init__(self, **kwargs): self.disable_gateway = kwargs.get('disable_gateway', False) -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 ApiContract(Resource): """Api details. @@ -773,12 +856,12 @@ 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 virtual_network_configuration: Virtual network configuration of the API Management service. @@ -851,6 +934,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 = { @@ -890,6 +977,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): @@ -915,6 +1003,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): @@ -1138,12 +1227,12 @@ 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 virtual_network_configuration: Virtual network configuration of the API Management service. @@ -1216,6 +1305,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 +1323,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 = { @@ -1281,12 +1377,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): @@ -1312,12 +1410,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 +1426,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,12 +1501,12 @@ 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 virtual_network_configuration: Virtual network configuration of the API Management service. @@ -1479,6 +1579,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. @@ -1540,6 +1644,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'}, @@ -1570,6 +1675,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) @@ -2383,6 +2489,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 +2798,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 +2813,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 +2827,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 +2923,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 +2943,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 +2957,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 +3086,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 +3100,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 +3110,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 +3118,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 +3129,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 +3140,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 +3155,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 +3219,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 +3240,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 +3248,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 +3363,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 +3374,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 +3384,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 +3395,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 +3643,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 +3669,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 +3682,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): @@ -3610,6 +3964,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 +3985,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 +3995,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 +4303,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. @@ -3968,6 +4338,7 @@ 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'}, @@ -3980,6 +4351,7 @@ 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) @@ -3994,17 +4366,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 +4930,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 +5022,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 +5044,6 @@ class LoggerContract(Resource): 'type': {'readonly': True}, 'logger_type': {'required': True}, 'description': {'max_length': 256}, - 'credentials': {'required': True}, } _attribute_map = { @@ -4618,7 +5070,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 +5124,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 +5135,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 +5146,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 +5155,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 +5181,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 +5197,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 +5208,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 +5217,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 +5246,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 +5277,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 +5293,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 +5302,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): @@ -5489,18 +5972,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 +6069,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 +6085,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 +6143,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. @@ -6014,22 +6640,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,6 +6752,26 @@ 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. @@ -6680,7 +7310,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 +7606,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 +7813,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 +8101,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 +8284,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 1e014d4da6593..ac98194f04c2d 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,14 +185,17 @@ 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 virtual_network_configuration: Virtual network configuration for the location. @@ -107,6 +221,7 @@ 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]'}, 'virtual_network_configuration': {'key': 'virtualNetworkConfiguration', 'type': 'VirtualNetworkConfiguration'}, @@ -114,10 +229,11 @@ class AdditionalLocation(Model): '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, 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.virtual_network_configuration = virtual_network_configuration @@ -125,39 +241,6 @@ def __init__(self, *, location: str, sku, virtual_network_configuration=None, di self.disable_gateway = disable_gateway -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 ApiContract(Resource): """Api details. @@ -773,12 +856,12 @@ 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 virtual_network_configuration: Virtual network configuration of the API Management service. @@ -851,6 +934,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 = { @@ -890,9 +977,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, 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 @@ -915,6 +1003,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): @@ -1138,12 +1227,12 @@ 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 virtual_network_configuration: Virtual network configuration of the API Management service. @@ -1216,6 +1305,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 +1323,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 = { @@ -1281,15 +1377,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, 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 @@ -1312,12 +1410,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 +1426,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,12 +1501,12 @@ 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 virtual_network_configuration: Virtual network configuration of the API Management service. @@ -1479,6 +1579,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. @@ -1540,6 +1644,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 +1652,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, 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 @@ -1570,6 +1675,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 @@ -2383,6 +2489,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 +2798,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 +2813,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 +2923,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 +2943,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 +2955,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 +3086,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 +3100,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 +3110,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 +3129,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 +3140,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 +3219,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 +3240,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 +3363,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 +3374,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 +3384,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 +3643,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 +3669,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 +3682,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): @@ -3610,6 +3964,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 +3985,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 +4303,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. @@ -3968,6 +4338,7 @@ 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'}, @@ -3975,11 +4346,12 @@ class HostnameConfiguration(Model): 'certificate': {'key': 'certificate', 'type': 'CertificateInformation'}, } - 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, **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 @@ -3994,17 +4366,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 +4930,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 +5022,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 +5044,6 @@ class LoggerContract(Resource): 'type': {'readonly': True}, 'logger_type': {'required': True}, 'description': {'max_length': 256}, - 'credentials': {'required': True}, } _attribute_map = { @@ -4605,7 +5057,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 +5070,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 +5124,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 +5135,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 +5146,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 +5181,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 +5197,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 +5208,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 +5246,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 +5277,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 +5293,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): @@ -5489,18 +5972,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 +6069,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 +6085,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 +6143,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. @@ -6014,22 +6640,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,6 +6752,26 @@ 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. @@ -6680,7 +7310,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 +7606,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 +7813,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 +8101,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 +8284,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 bc1ee244cc6cc..c047b5620a4b9 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 @@ -415,6 +454,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 +519,32 @@ 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 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 2dae331a8203f..0ffa552163f81 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 @@ -50,6 +53,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 +67,7 @@ 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 ._subscription_operations import SubscriptionOperations from ._tag_resource_operations import TagResourceOperations from ._tenant_access_operations import TenantAccessOperations @@ -95,6 +101,9 @@ 'BackendOperations', 'CacheOperations', 'CertificateOperations', + 'ContentTypeOperations', + 'ContentItemOperations', + 'DeletedServicesOperations', 'ApiManagementOperations', 'ApiManagementServiceSkusOperations', 'ApiManagementServiceOperations', @@ -116,6 +125,8 @@ 'OpenIdConnectProviderOperations', 'PolicyOperations', 'PolicyDescriptionOperations', + 'PortalRevisionOperations', + 'PortalSettingsOperations', 'SignInSettingsOperations', 'SignUpSettingsOperations', 'DelegationSettingsOperations', @@ -128,6 +139,7 @@ 'QuotaByPeriodKeysOperations', 'RegionOperations', 'ReportsOperations', + 'TenantSettingsOperations', '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 57f5d5b498786..56009b563134e 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: "2020-06-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 = "2020-06-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 ab05e246f6471..0a26c8d81be96 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: "2020-06-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 = "2020-06-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 91257c1171a58..a7682a5470437 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: "2020-06-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 = "2020-06-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 513853155a04a..5c219ed7e167e 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: "2020-06-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 = "2020-06-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 36d063df0a8ee..ca591fd789dd6 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: "2020-06-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 = "2020-06-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 e221fb1e1faa7..76fea0027d9c9 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: "2020-06-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 = "2020-06-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 7daa7858229fb..f9a06dcf9ebd6 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: "2020-06-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 = "2020-06-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 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 bfe3b31eb23dc..c17bdb6b62af2 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: "2020-06-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 = "2020-06-01-preview" self.config = config 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 547d6e392dcb9..aa39d0c3803a6 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: "2020-06-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 = "2020-06-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 522445c42c20d..d963f314d0702 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: "2020-06-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 = "2020-06-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 17e65e2bf7413..0604bc8bfee30 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: "2020-06-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 = "2020-06-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 195c7415eb569..4ec78259b60e6 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: "2020-06-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 = "2020-06-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 14b7f8245e8aa..23ab4bf7a61c6 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: "2020-06-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 = "2020-06-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 4ad8834133577..91a5a086796a0 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: "2020-06-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 = "2020-06-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 c69ddf7d3e3e6..bba597ed959d8 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: "2020-06-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 = "2020-06-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 d681f90359af1..cbb34c0d328de 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: "2020-06-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 = "2020-06-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 ee1c4ece98cd7..1550b0e578623 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: "2020-06-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 = "2020-06-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 58db85d6f681a..8d73bcf47409f 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: "2020-06-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 = "2020-06-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 9ec7b59cd053f..5bd970dec931a 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: "2020-06-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 = "2020-06-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 e871231af7832..db09c1f1e0d1e 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: "2020-06-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 = "2020-06-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 3f0926176117f..eb0b859478ccf 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: "2020-06-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 = "2020-06-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 ab5870bb7998d..9a3e54a32e1d5 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: "2020-06-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 = "2020-06-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 0000000000000..5ef5fe98056d1 --- /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: "2020-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-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 0000000000000..cd83644eed252 --- /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: "2020-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-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 41ae87b612610..066f06df59e7a 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: "2020-06-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 = "2020-06-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 0000000000000..edab9851c8a7b --- /dev/null +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py @@ -0,0 +1,225 @@ +# 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 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: "2020-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-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( + self, service_name, location, custom_headers=None, raw=False, **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: 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.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 + 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 e9d29894949ac..4745bf0c33fd5 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: "2020-06-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 = "2020-06-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 aee6bc1b4943d..3de4ad9bfe707 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: "2020-06-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 = "2020-06-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 a26b4fe763872..c6fe11f309a8d 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: "2020-06-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 = "2020-06-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_hostname_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_hostname_configuration_operations.py index 8f7ac6aecb3fb..b34f76ca22476 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: "2020-06-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 = "2020-06-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 40f29ec66b834..4505604aad5a6 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: "2020-06-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 = "2020-06-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 e8c8e9496ed45..41d89ad32acb8 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: "2020-06-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 = "2020-06-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 abfb01cb5772e..879053f7ad782 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: "2020-06-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 = "2020-06-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 458ed98212a13..03be4a6a55a78 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: "2020-06-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 = "2020-06-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 505fff7472738..2a6ecd07a4938 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: "2020-06-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 = "2020-06-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 92dea27d29d3c..adbbd500f0c2f 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: "2020-06-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 = "2020-06-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 7cc52f6fb5aa2..ac023832beef9 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: "2020-06-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 = "2020-06-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 1d1470f7a5cea..c95886a724f08 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: "2020-06-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 = "2020-06-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 7642c25b90f71..deaed93e43e84 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: "2020-06-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 = "2020-06-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 0010945f33a9c..979234742c928 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: "2020-06-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 = "2020-06-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 584a10409e5f6..6d118ba108acc 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: "2020-06-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 = "2020-06-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 8f2b7565010d4..930229b392176 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: "2020-06-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 = "2020-06-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 20c50ea274940..2c2b66e90df4c 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: "2020-06-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 = "2020-06-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 9dd71e8a269cd..0daf0305d917e 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: "2020-06-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 = "2020-06-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 3a64140c6a9f1..b3a4e6b2ae0bc 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: "2020-06-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 = "2020-06-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 0000000000000..efc99a3d79cd2 --- /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: "2020-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-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 0000000000000..5195f74b37714 --- /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: "2020-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-06-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 2e8b6c46c5194..126ff1473d281 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: "2020-06-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 = "2020-06-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 da974b742face..811d1109cac57 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: "2020-06-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 = "2020-06-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 4f46d390296fc..bee1c897e1458 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: "2020-06-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 = "2020-06-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 c1092714069e8..3fc674b452ddc 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: "2020-06-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 = "2020-06-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 9a6079a07e700..773be125bd7cf 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: "2020-06-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 = "2020-06-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 0d4220b0cfd6a..afd9321629de7 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: "2020-06-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 = "2020-06-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 db29c87e0c049..756f409f628c7 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: "2020-06-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 = "2020-06-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 e2c5b8b6b2ef6..11b7a38ca519a 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: "2020-06-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 = "2020-06-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 ce71756ffbd8b..dbd49f226bcc0 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: "2020-06-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 = "2020-06-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 5153013797413..97487efe01d08 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: "2020-06-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 = "2020-06-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 01e8bd6c0d9dd..6fa68484ed07d 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: "2020-06-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 = "2020-06-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 c6dbaa8925362..4a7d0697d9a8d 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: "2020-06-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 = "2020-06-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 fcae3c76c7551..d3973783cf6b6 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: "2020-06-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 = "2020-06-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 968cfec99052b..843a6cd81c073 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: "2020-06-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 = "2020-06-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 56879020577a9..5fb9cd68e99d8 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: "2020-06-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 = "2020-06-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', 'getAccess' + :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', 'getAccess' + :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 ac6665edb7de2..d76bd740091f8 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: "2020-06-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 = "2020-06-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', 'getAccess' + :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', 'getAccess' + :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', 'getAccess' + :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', 'getAccess' + :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', 'getAccess' + :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', 'getAccess' + :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', 'getAccess' + :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 e08d0f7c5e8f1..f898cbf46dad2 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: "2020-06-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 = "2020-06-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 0000000000000..63161bd9e2b33 --- /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: "2020-06-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 = "2020-06-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 193c9b412fe3d..0febb692cf991 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: "2020-06-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 = "2020-06-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 947c714ca66f4..73ec36101358d 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: "2020-06-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 = "2020-06-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 ac5de590d1b68..83273821e05db 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: "2020-06-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 = "2020-06-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 2fd37c3c6203b..9076b903fb34a 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: "2020-06-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 = "2020-06-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 cbf13b40c7e8b..88ab26a5d4624 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: "2020-06-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 = "2020-06-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}'}