diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/_meta.json b/sdk/apimanagement/azure-mgmt-apimanagement/_meta.json index 1208e022ae8a..ecaa5035f345 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/_meta.json +++ b/sdk/apimanagement/azure-mgmt-apimanagement/_meta.json @@ -1,11 +1,11 @@ { "autorest": "3.7.2", "use": [ - "@autorest/python@5.12.0", + "@autorest/python@5.13.0", "@autorest/modelerfour@4.19.3" ], - "commit": "0b70eafc6469141d5c4dc868c4a4438db6c32ead", + "commit": "eb2b882ef0a4aa5956ca38cfa566fc4d7cfb3fb0", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/apimanagement/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", + "autorest_command": "autorest specification/apimanagement/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2", "readme": "specification/apimanagement/resource-manager/readme.md" } \ No newline at end of file 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 076c212079e5..c27d30dbb07a 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 @@ -7,11 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Optional, TYPE_CHECKING +from typing import Any, TYPE_CHECKING + +from msrest import Deserializer, Serializer from azure.core.rest import HttpRequest, HttpResponse from azure.mgmt.core import ARMPipelineClient -from msrest import Deserializer, Serializer from . import models from ._configuration import ApiManagementClientConfiguration @@ -21,178 +22,185 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials import TokenCredential -class ApiManagementClient(ApiManagementClientOperationsMixin): +class ApiManagementClient(ApiManagementClientOperationsMixin): # pylint: disable=too-many-instance-attributes """ApiManagement Client. :ivar api: ApiOperations operations - :vartype api: api_management_client.operations.ApiOperations + :vartype api: azure.mgmt.apimanagement.operations.ApiOperations :ivar api_revision: ApiRevisionOperations operations - :vartype api_revision: api_management_client.operations.ApiRevisionOperations + :vartype api_revision: azure.mgmt.apimanagement.operations.ApiRevisionOperations :ivar api_release: ApiReleaseOperations operations - :vartype api_release: api_management_client.operations.ApiReleaseOperations + :vartype api_release: azure.mgmt.apimanagement.operations.ApiReleaseOperations :ivar api_operation: ApiOperationOperations operations - :vartype api_operation: api_management_client.operations.ApiOperationOperations + :vartype api_operation: azure.mgmt.apimanagement.operations.ApiOperationOperations :ivar api_operation_policy: ApiOperationPolicyOperations operations - :vartype api_operation_policy: api_management_client.operations.ApiOperationPolicyOperations + :vartype api_operation_policy: azure.mgmt.apimanagement.operations.ApiOperationPolicyOperations :ivar tag: TagOperations operations - :vartype tag: api_management_client.operations.TagOperations + :vartype tag: azure.mgmt.apimanagement.operations.TagOperations :ivar api_product: ApiProductOperations operations - :vartype api_product: api_management_client.operations.ApiProductOperations + :vartype api_product: azure.mgmt.apimanagement.operations.ApiProductOperations :ivar api_policy: ApiPolicyOperations operations - :vartype api_policy: api_management_client.operations.ApiPolicyOperations + :vartype api_policy: azure.mgmt.apimanagement.operations.ApiPolicyOperations :ivar api_schema: ApiSchemaOperations operations - :vartype api_schema: api_management_client.operations.ApiSchemaOperations + :vartype api_schema: azure.mgmt.apimanagement.operations.ApiSchemaOperations :ivar api_diagnostic: ApiDiagnosticOperations operations - :vartype api_diagnostic: api_management_client.operations.ApiDiagnosticOperations + :vartype api_diagnostic: azure.mgmt.apimanagement.operations.ApiDiagnosticOperations :ivar api_issue: ApiIssueOperations operations - :vartype api_issue: api_management_client.operations.ApiIssueOperations + :vartype api_issue: azure.mgmt.apimanagement.operations.ApiIssueOperations :ivar api_issue_comment: ApiIssueCommentOperations operations - :vartype api_issue_comment: api_management_client.operations.ApiIssueCommentOperations + :vartype api_issue_comment: azure.mgmt.apimanagement.operations.ApiIssueCommentOperations :ivar api_issue_attachment: ApiIssueAttachmentOperations operations - :vartype api_issue_attachment: api_management_client.operations.ApiIssueAttachmentOperations + :vartype api_issue_attachment: azure.mgmt.apimanagement.operations.ApiIssueAttachmentOperations :ivar api_tag_description: ApiTagDescriptionOperations operations - :vartype api_tag_description: api_management_client.operations.ApiTagDescriptionOperations + :vartype api_tag_description: azure.mgmt.apimanagement.operations.ApiTagDescriptionOperations :ivar operation: OperationOperations operations - :vartype operation: api_management_client.operations.OperationOperations + :vartype operation: azure.mgmt.apimanagement.operations.OperationOperations :ivar api_export: ApiExportOperations operations - :vartype api_export: api_management_client.operations.ApiExportOperations + :vartype api_export: azure.mgmt.apimanagement.operations.ApiExportOperations :ivar api_version_set: ApiVersionSetOperations operations - :vartype api_version_set: api_management_client.operations.ApiVersionSetOperations + :vartype api_version_set: azure.mgmt.apimanagement.operations.ApiVersionSetOperations :ivar authorization_server: AuthorizationServerOperations operations - :vartype authorization_server: api_management_client.operations.AuthorizationServerOperations + :vartype authorization_server: + azure.mgmt.apimanagement.operations.AuthorizationServerOperations :ivar backend: BackendOperations operations - :vartype backend: api_management_client.operations.BackendOperations + :vartype backend: azure.mgmt.apimanagement.operations.BackendOperations :ivar cache: CacheOperations operations - :vartype cache: api_management_client.operations.CacheOperations + :vartype cache: azure.mgmt.apimanagement.operations.CacheOperations :ivar certificate: CertificateOperations operations - :vartype certificate: api_management_client.operations.CertificateOperations + :vartype certificate: azure.mgmt.apimanagement.operations.CertificateOperations :ivar content_type: ContentTypeOperations operations - :vartype content_type: api_management_client.operations.ContentTypeOperations + :vartype content_type: azure.mgmt.apimanagement.operations.ContentTypeOperations :ivar content_item: ContentItemOperations operations - :vartype content_item: api_management_client.operations.ContentItemOperations + :vartype content_item: azure.mgmt.apimanagement.operations.ContentItemOperations :ivar deleted_services: DeletedServicesOperations operations - :vartype deleted_services: api_management_client.operations.DeletedServicesOperations + :vartype deleted_services: azure.mgmt.apimanagement.operations.DeletedServicesOperations :ivar api_management_operations: ApiManagementOperationsOperations operations :vartype api_management_operations: - api_management_client.operations.ApiManagementOperationsOperations + azure.mgmt.apimanagement.operations.ApiManagementOperationsOperations :ivar api_management_service_skus: ApiManagementServiceSkusOperations operations :vartype api_management_service_skus: - api_management_client.operations.ApiManagementServiceSkusOperations + azure.mgmt.apimanagement.operations.ApiManagementServiceSkusOperations :ivar api_management_service: ApiManagementServiceOperations operations :vartype api_management_service: - api_management_client.operations.ApiManagementServiceOperations + azure.mgmt.apimanagement.operations.ApiManagementServiceOperations :ivar diagnostic: DiagnosticOperations operations - :vartype diagnostic: api_management_client.operations.DiagnosticOperations + :vartype diagnostic: azure.mgmt.apimanagement.operations.DiagnosticOperations :ivar email_template: EmailTemplateOperations operations - :vartype email_template: api_management_client.operations.EmailTemplateOperations + :vartype email_template: azure.mgmt.apimanagement.operations.EmailTemplateOperations :ivar gateway: GatewayOperations operations - :vartype gateway: api_management_client.operations.GatewayOperations + :vartype gateway: azure.mgmt.apimanagement.operations.GatewayOperations :ivar gateway_hostname_configuration: GatewayHostnameConfigurationOperations operations :vartype gateway_hostname_configuration: - api_management_client.operations.GatewayHostnameConfigurationOperations + azure.mgmt.apimanagement.operations.GatewayHostnameConfigurationOperations :ivar gateway_api: GatewayApiOperations operations - :vartype gateway_api: api_management_client.operations.GatewayApiOperations + :vartype gateway_api: azure.mgmt.apimanagement.operations.GatewayApiOperations :ivar gateway_certificate_authority: GatewayCertificateAuthorityOperations operations :vartype gateway_certificate_authority: - api_management_client.operations.GatewayCertificateAuthorityOperations + azure.mgmt.apimanagement.operations.GatewayCertificateAuthorityOperations :ivar group: GroupOperations operations - :vartype group: api_management_client.operations.GroupOperations + :vartype group: azure.mgmt.apimanagement.operations.GroupOperations :ivar group_user: GroupUserOperations operations - :vartype group_user: api_management_client.operations.GroupUserOperations + :vartype group_user: azure.mgmt.apimanagement.operations.GroupUserOperations :ivar identity_provider: IdentityProviderOperations operations - :vartype identity_provider: api_management_client.operations.IdentityProviderOperations + :vartype identity_provider: azure.mgmt.apimanagement.operations.IdentityProviderOperations :ivar issue: IssueOperations operations - :vartype issue: api_management_client.operations.IssueOperations + :vartype issue: azure.mgmt.apimanagement.operations.IssueOperations :ivar logger: LoggerOperations operations - :vartype logger: api_management_client.operations.LoggerOperations + :vartype logger: azure.mgmt.apimanagement.operations.LoggerOperations :ivar named_value: NamedValueOperations operations - :vartype named_value: api_management_client.operations.NamedValueOperations + :vartype named_value: azure.mgmt.apimanagement.operations.NamedValueOperations :ivar network_status: NetworkStatusOperations operations - :vartype network_status: api_management_client.operations.NetworkStatusOperations + :vartype network_status: azure.mgmt.apimanagement.operations.NetworkStatusOperations :ivar notification: NotificationOperations operations - :vartype notification: api_management_client.operations.NotificationOperations + :vartype notification: azure.mgmt.apimanagement.operations.NotificationOperations :ivar notification_recipient_user: NotificationRecipientUserOperations operations :vartype notification_recipient_user: - api_management_client.operations.NotificationRecipientUserOperations + azure.mgmt.apimanagement.operations.NotificationRecipientUserOperations :ivar notification_recipient_email: NotificationRecipientEmailOperations operations :vartype notification_recipient_email: - api_management_client.operations.NotificationRecipientEmailOperations + azure.mgmt.apimanagement.operations.NotificationRecipientEmailOperations :ivar open_id_connect_provider: OpenIdConnectProviderOperations operations :vartype open_id_connect_provider: - api_management_client.operations.OpenIdConnectProviderOperations + azure.mgmt.apimanagement.operations.OpenIdConnectProviderOperations :ivar outbound_network_dependencies_endpoints: OutboundNetworkDependenciesEndpointsOperations operations :vartype outbound_network_dependencies_endpoints: - api_management_client.operations.OutboundNetworkDependenciesEndpointsOperations + azure.mgmt.apimanagement.operations.OutboundNetworkDependenciesEndpointsOperations :ivar policy: PolicyOperations operations - :vartype policy: api_management_client.operations.PolicyOperations + :vartype policy: azure.mgmt.apimanagement.operations.PolicyOperations :ivar policy_description: PolicyDescriptionOperations operations - :vartype policy_description: api_management_client.operations.PolicyDescriptionOperations + :vartype policy_description: azure.mgmt.apimanagement.operations.PolicyDescriptionOperations :ivar portal_revision: PortalRevisionOperations operations - :vartype portal_revision: api_management_client.operations.PortalRevisionOperations + :vartype portal_revision: azure.mgmt.apimanagement.operations.PortalRevisionOperations :ivar portal_settings: PortalSettingsOperations operations - :vartype portal_settings: api_management_client.operations.PortalSettingsOperations + :vartype portal_settings: azure.mgmt.apimanagement.operations.PortalSettingsOperations :ivar sign_in_settings: SignInSettingsOperations operations - :vartype sign_in_settings: api_management_client.operations.SignInSettingsOperations + :vartype sign_in_settings: azure.mgmt.apimanagement.operations.SignInSettingsOperations :ivar sign_up_settings: SignUpSettingsOperations operations - :vartype sign_up_settings: api_management_client.operations.SignUpSettingsOperations + :vartype sign_up_settings: azure.mgmt.apimanagement.operations.SignUpSettingsOperations :ivar delegation_settings: DelegationSettingsOperations operations - :vartype delegation_settings: api_management_client.operations.DelegationSettingsOperations + :vartype delegation_settings: azure.mgmt.apimanagement.operations.DelegationSettingsOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations :vartype private_endpoint_connection: - api_management_client.operations.PrivateEndpointConnectionOperations + azure.mgmt.apimanagement.operations.PrivateEndpointConnectionOperations :ivar product: ProductOperations operations - :vartype product: api_management_client.operations.ProductOperations + :vartype product: azure.mgmt.apimanagement.operations.ProductOperations :ivar product_api: ProductApiOperations operations - :vartype product_api: api_management_client.operations.ProductApiOperations + :vartype product_api: azure.mgmt.apimanagement.operations.ProductApiOperations :ivar product_group: ProductGroupOperations operations - :vartype product_group: api_management_client.operations.ProductGroupOperations + :vartype product_group: azure.mgmt.apimanagement.operations.ProductGroupOperations :ivar product_subscriptions: ProductSubscriptionsOperations operations - :vartype product_subscriptions: api_management_client.operations.ProductSubscriptionsOperations + :vartype product_subscriptions: + azure.mgmt.apimanagement.operations.ProductSubscriptionsOperations :ivar product_policy: ProductPolicyOperations operations - :vartype product_policy: api_management_client.operations.ProductPolicyOperations + :vartype product_policy: azure.mgmt.apimanagement.operations.ProductPolicyOperations :ivar quota_by_counter_keys: QuotaByCounterKeysOperations operations - :vartype quota_by_counter_keys: api_management_client.operations.QuotaByCounterKeysOperations + :vartype quota_by_counter_keys: + azure.mgmt.apimanagement.operations.QuotaByCounterKeysOperations :ivar quota_by_period_keys: QuotaByPeriodKeysOperations operations - :vartype quota_by_period_keys: api_management_client.operations.QuotaByPeriodKeysOperations + :vartype quota_by_period_keys: azure.mgmt.apimanagement.operations.QuotaByPeriodKeysOperations :ivar region: RegionOperations operations - :vartype region: api_management_client.operations.RegionOperations + :vartype region: azure.mgmt.apimanagement.operations.RegionOperations :ivar reports: ReportsOperations operations - :vartype reports: api_management_client.operations.ReportsOperations + :vartype reports: azure.mgmt.apimanagement.operations.ReportsOperations :ivar global_schema: GlobalSchemaOperations operations - :vartype global_schema: api_management_client.operations.GlobalSchemaOperations + :vartype global_schema: azure.mgmt.apimanagement.operations.GlobalSchemaOperations :ivar tenant_settings: TenantSettingsOperations operations - :vartype tenant_settings: api_management_client.operations.TenantSettingsOperations + :vartype tenant_settings: azure.mgmt.apimanagement.operations.TenantSettingsOperations :ivar api_management_skus: ApiManagementSkusOperations operations - :vartype api_management_skus: api_management_client.operations.ApiManagementSkusOperations + :vartype api_management_skus: azure.mgmt.apimanagement.operations.ApiManagementSkusOperations :ivar subscription: SubscriptionOperations operations - :vartype subscription: api_management_client.operations.SubscriptionOperations + :vartype subscription: azure.mgmt.apimanagement.operations.SubscriptionOperations :ivar tag_resource: TagResourceOperations operations - :vartype tag_resource: api_management_client.operations.TagResourceOperations + :vartype tag_resource: azure.mgmt.apimanagement.operations.TagResourceOperations :ivar tenant_access: TenantAccessOperations operations - :vartype tenant_access: api_management_client.operations.TenantAccessOperations + :vartype tenant_access: azure.mgmt.apimanagement.operations.TenantAccessOperations :ivar tenant_access_git: TenantAccessGitOperations operations - :vartype tenant_access_git: api_management_client.operations.TenantAccessGitOperations + :vartype tenant_access_git: azure.mgmt.apimanagement.operations.TenantAccessGitOperations :ivar tenant_configuration: TenantConfigurationOperations operations - :vartype tenant_configuration: api_management_client.operations.TenantConfigurationOperations + :vartype tenant_configuration: + azure.mgmt.apimanagement.operations.TenantConfigurationOperations :ivar user: UserOperations operations - :vartype user: api_management_client.operations.UserOperations + :vartype user: azure.mgmt.apimanagement.operations.UserOperations :ivar user_group: UserGroupOperations operations - :vartype user_group: api_management_client.operations.UserGroupOperations + :vartype user_group: azure.mgmt.apimanagement.operations.UserGroupOperations :ivar user_subscription: UserSubscriptionOperations operations - :vartype user_subscription: api_management_client.operations.UserSubscriptionOperations + :vartype user_subscription: azure.mgmt.apimanagement.operations.UserSubscriptionOperations :ivar user_identities: UserIdentitiesOperations operations - :vartype user_identities: api_management_client.operations.UserIdentitiesOperations + :vartype user_identities: azure.mgmt.apimanagement.operations.UserIdentitiesOperations :ivar user_confirmation_password: UserConfirmationPasswordOperations operations :vartype user_confirmation_password: - api_management_client.operations.UserConfirmationPasswordOperations + azure.mgmt.apimanagement.operations.UserConfirmationPasswordOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2021-08-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -290,7 +298,7 @@ def __init__( def _send_request( self, - request, # type: HttpRequest + request: HttpRequest, **kwargs: Any ) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py index 6644ed21cee1..9acaea70c73c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials import TokenCredential -class ApiManagementClientConfiguration(Configuration): +class ApiManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ApiManagementClient. Note that all parameters used to create this instance are saved as instance @@ -27,8 +27,12 @@ class ApiManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-08-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -38,6 +42,8 @@ def __init__( **kwargs: Any ) -> None: super(ApiManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -45,7 +51,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-08-01" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-apimanagement/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_metadata.json b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_metadata.json index 4d4ecf9095d3..76ac32fcc102 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_metadata.json +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_metadata.json @@ -10,8 +10,8 @@ "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApiManagementClientConfiguration\"], \"._operations_mixin\": [\"ApiManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApiManagementClientConfiguration\"], \"._operations_mixin\": [\"ApiManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApiManagementClientConfiguration\"], \"._operations_mixin\": [\"ApiManagementClientOperationsMixin\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ApiManagementClientConfiguration\"], \"._operations_mixin\": [\"ApiManagementClientOperationsMixin\"]}, \"thirdparty\": {\"msrest\": [\"Deserializer\", \"Serializer\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}" }, "global_parameters": { "sync": { @@ -180,24 +180,24 @@ "_perform_connectivity_check_async_initial" : { "sync": { "signature": "def _perform_connectivity_check_async_initial(\n self,\n resource_group_name, # type: str\n service_name, # type: str\n connectivity_check_request_params, # type: \"_models.ConnectivityCheckRequest\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e Optional[\"_models.ConnectivityCheckResponse\"]\n", - "doc": "\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params: ~api_management_client.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ConnectivityCheckResponse, or the result of cls(response)\n:rtype: ~api_management_client.models.ConnectivityCheckResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ConnectivityCheckResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.apimanagement.models.ConnectivityCheckResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def _perform_connectivity_check_async_initial(\n self,\n resource_group_name: str,\n service_name: str,\n connectivity_check_request_params: \"_models.ConnectivityCheckRequest\",\n **kwargs: Any\n) -\u003e Optional[\"_models.ConnectivityCheckResponse\"]:\n", - "doc": "\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params: ~api_management_client.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ConnectivityCheckResponse, or the result of cls(response)\n:rtype: ~api_management_client.models.ConnectivityCheckResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: ConnectivityCheckResponse, or the result of cls(response)\n:rtype: ~azure.mgmt.apimanagement.models.ConnectivityCheckResponse or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, service_name, connectivity_check_request_params" }, "begin_perform_connectivity_check_async" : { "sync": { "signature": "def begin_perform_connectivity_check_async(\n self,\n resource_group_name, # type: str\n service_name, # type: str\n connectivity_check_request_params, # type: \"_models.ConnectivityCheckRequest\"\n **kwargs # type: Any\n):\n # type: (...) -\u003e LROPoller[\"_models.ConnectivityCheckResponse\"]\n", - "doc": "\"\"\"Performs a connectivity check between the API Management service and a given destination, and\nreturns metrics for the connection, as well as errors encountered while trying to establish it.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params: ~api_management_client.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either ConnectivityCheckResponse or the result\n of cls(response)\n:rtype: ~azure.core.polling.LROPoller[~api_management_client.models.ConnectivityCheckResponse]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Performs a connectivity check between the API Management service and a given destination, and\nreturns metrics for the connection, as well as errors encountered while trying to establish it.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be ARMPolling. Pass in False for this\n operation to not poll, or pass in your own initialized polling object for a personal polling\n strategy.\n:paramtype polling: bool or ~azure.core.polling.PollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of LROPoller that returns either ConnectivityCheckResponse or the result\n of cls(response)\n:rtype:\n ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ConnectivityCheckResponse]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "async": { "coroutine": true, "signature": "async def begin_perform_connectivity_check_async(\n self,\n resource_group_name: str,\n service_name: str,\n connectivity_check_request_params: \"_models.ConnectivityCheckRequest\",\n **kwargs: Any\n) -\u003e AsyncLROPoller[\"_models.ConnectivityCheckResponse\"]:\n", - "doc": "\"\"\"Performs a connectivity check between the API Management service and a given destination, and\nreturns metrics for the connection, as well as errors encountered while trying to establish it.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params: ~api_management_client.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either ConnectivityCheckResponse or the\n result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ConnectivityCheckResponse]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + "doc": "\"\"\"Performs a connectivity check between the API Management service and a given destination, and\nreturns metrics for the connection, as well as errors encountered while trying to establish it.\n\n:param resource_group_name: The name of the resource group.\n:type resource_group_name: str\n:param service_name: The name of the API Management service.\n:type service_name: str\n:param connectivity_check_request_params: Connectivity Check request parameters.\n:type connectivity_check_request_params:\n ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest\n:keyword callable cls: A custom type or function that will be passed the direct response\n:keyword str continuation_token: A continuation token to restart a poller from a saved state.\n:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for\n this operation to not poll, or pass in your own initialized polling object for a personal\n polling strategy.\n:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod\n:keyword int polling_interval: Default waiting time between two polls for LRO operations if no\n Retry-After header is present.\n:return: An instance of AsyncLROPoller that returns either ConnectivityCheckResponse or the\n result of cls(response)\n:rtype:\n ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ConnectivityCheckResponse]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" }, "call": "resource_group_name, service_name, connectivity_check_request_params" } diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_version.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_version.py index cac9f5d10f8b..e5754a47ce68 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_version.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.0" +VERSION = "1.0.0b1" diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py index 7d65b6a09b3f..af55f6d2793a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_api_management_client.py @@ -7,11 +7,12 @@ # -------------------------------------------------------------------------- from copy import deepcopy -from typing import Any, Awaitable, Optional, TYPE_CHECKING +from typing import Any, Awaitable, TYPE_CHECKING + +from msrest import Deserializer, Serializer from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient -from msrest import Deserializer, Serializer from .. import models from ._configuration import ApiManagementClientConfiguration @@ -21,184 +22,192 @@ # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential -class ApiManagementClient(ApiManagementClientOperationsMixin): +class ApiManagementClient(ApiManagementClientOperationsMixin): # pylint: disable=too-many-instance-attributes """ApiManagement Client. :ivar api: ApiOperations operations - :vartype api: api_management_client.aio.operations.ApiOperations + :vartype api: azure.mgmt.apimanagement.aio.operations.ApiOperations :ivar api_revision: ApiRevisionOperations operations - :vartype api_revision: api_management_client.aio.operations.ApiRevisionOperations + :vartype api_revision: azure.mgmt.apimanagement.aio.operations.ApiRevisionOperations :ivar api_release: ApiReleaseOperations operations - :vartype api_release: api_management_client.aio.operations.ApiReleaseOperations + :vartype api_release: azure.mgmt.apimanagement.aio.operations.ApiReleaseOperations :ivar api_operation: ApiOperationOperations operations - :vartype api_operation: api_management_client.aio.operations.ApiOperationOperations + :vartype api_operation: azure.mgmt.apimanagement.aio.operations.ApiOperationOperations :ivar api_operation_policy: ApiOperationPolicyOperations operations :vartype api_operation_policy: - api_management_client.aio.operations.ApiOperationPolicyOperations + azure.mgmt.apimanagement.aio.operations.ApiOperationPolicyOperations :ivar tag: TagOperations operations - :vartype tag: api_management_client.aio.operations.TagOperations + :vartype tag: azure.mgmt.apimanagement.aio.operations.TagOperations :ivar api_product: ApiProductOperations operations - :vartype api_product: api_management_client.aio.operations.ApiProductOperations + :vartype api_product: azure.mgmt.apimanagement.aio.operations.ApiProductOperations :ivar api_policy: ApiPolicyOperations operations - :vartype api_policy: api_management_client.aio.operations.ApiPolicyOperations + :vartype api_policy: azure.mgmt.apimanagement.aio.operations.ApiPolicyOperations :ivar api_schema: ApiSchemaOperations operations - :vartype api_schema: api_management_client.aio.operations.ApiSchemaOperations + :vartype api_schema: azure.mgmt.apimanagement.aio.operations.ApiSchemaOperations :ivar api_diagnostic: ApiDiagnosticOperations operations - :vartype api_diagnostic: api_management_client.aio.operations.ApiDiagnosticOperations + :vartype api_diagnostic: azure.mgmt.apimanagement.aio.operations.ApiDiagnosticOperations :ivar api_issue: ApiIssueOperations operations - :vartype api_issue: api_management_client.aio.operations.ApiIssueOperations + :vartype api_issue: azure.mgmt.apimanagement.aio.operations.ApiIssueOperations :ivar api_issue_comment: ApiIssueCommentOperations operations - :vartype api_issue_comment: api_management_client.aio.operations.ApiIssueCommentOperations + :vartype api_issue_comment: azure.mgmt.apimanagement.aio.operations.ApiIssueCommentOperations :ivar api_issue_attachment: ApiIssueAttachmentOperations operations :vartype api_issue_attachment: - api_management_client.aio.operations.ApiIssueAttachmentOperations + azure.mgmt.apimanagement.aio.operations.ApiIssueAttachmentOperations :ivar api_tag_description: ApiTagDescriptionOperations operations - :vartype api_tag_description: api_management_client.aio.operations.ApiTagDescriptionOperations + :vartype api_tag_description: + azure.mgmt.apimanagement.aio.operations.ApiTagDescriptionOperations :ivar operation: OperationOperations operations - :vartype operation: api_management_client.aio.operations.OperationOperations + :vartype operation: azure.mgmt.apimanagement.aio.operations.OperationOperations :ivar api_export: ApiExportOperations operations - :vartype api_export: api_management_client.aio.operations.ApiExportOperations + :vartype api_export: azure.mgmt.apimanagement.aio.operations.ApiExportOperations :ivar api_version_set: ApiVersionSetOperations operations - :vartype api_version_set: api_management_client.aio.operations.ApiVersionSetOperations + :vartype api_version_set: azure.mgmt.apimanagement.aio.operations.ApiVersionSetOperations :ivar authorization_server: AuthorizationServerOperations operations :vartype authorization_server: - api_management_client.aio.operations.AuthorizationServerOperations + azure.mgmt.apimanagement.aio.operations.AuthorizationServerOperations :ivar backend: BackendOperations operations - :vartype backend: api_management_client.aio.operations.BackendOperations + :vartype backend: azure.mgmt.apimanagement.aio.operations.BackendOperations :ivar cache: CacheOperations operations - :vartype cache: api_management_client.aio.operations.CacheOperations + :vartype cache: azure.mgmt.apimanagement.aio.operations.CacheOperations :ivar certificate: CertificateOperations operations - :vartype certificate: api_management_client.aio.operations.CertificateOperations + :vartype certificate: azure.mgmt.apimanagement.aio.operations.CertificateOperations :ivar content_type: ContentTypeOperations operations - :vartype content_type: api_management_client.aio.operations.ContentTypeOperations + :vartype content_type: azure.mgmt.apimanagement.aio.operations.ContentTypeOperations :ivar content_item: ContentItemOperations operations - :vartype content_item: api_management_client.aio.operations.ContentItemOperations + :vartype content_item: azure.mgmt.apimanagement.aio.operations.ContentItemOperations :ivar deleted_services: DeletedServicesOperations operations - :vartype deleted_services: api_management_client.aio.operations.DeletedServicesOperations + :vartype deleted_services: azure.mgmt.apimanagement.aio.operations.DeletedServicesOperations :ivar api_management_operations: ApiManagementOperationsOperations operations :vartype api_management_operations: - api_management_client.aio.operations.ApiManagementOperationsOperations + azure.mgmt.apimanagement.aio.operations.ApiManagementOperationsOperations :ivar api_management_service_skus: ApiManagementServiceSkusOperations operations :vartype api_management_service_skus: - api_management_client.aio.operations.ApiManagementServiceSkusOperations + azure.mgmt.apimanagement.aio.operations.ApiManagementServiceSkusOperations :ivar api_management_service: ApiManagementServiceOperations operations :vartype api_management_service: - api_management_client.aio.operations.ApiManagementServiceOperations + azure.mgmt.apimanagement.aio.operations.ApiManagementServiceOperations :ivar diagnostic: DiagnosticOperations operations - :vartype diagnostic: api_management_client.aio.operations.DiagnosticOperations + :vartype diagnostic: azure.mgmt.apimanagement.aio.operations.DiagnosticOperations :ivar email_template: EmailTemplateOperations operations - :vartype email_template: api_management_client.aio.operations.EmailTemplateOperations + :vartype email_template: azure.mgmt.apimanagement.aio.operations.EmailTemplateOperations :ivar gateway: GatewayOperations operations - :vartype gateway: api_management_client.aio.operations.GatewayOperations + :vartype gateway: azure.mgmt.apimanagement.aio.operations.GatewayOperations :ivar gateway_hostname_configuration: GatewayHostnameConfigurationOperations operations :vartype gateway_hostname_configuration: - api_management_client.aio.operations.GatewayHostnameConfigurationOperations + azure.mgmt.apimanagement.aio.operations.GatewayHostnameConfigurationOperations :ivar gateway_api: GatewayApiOperations operations - :vartype gateway_api: api_management_client.aio.operations.GatewayApiOperations + :vartype gateway_api: azure.mgmt.apimanagement.aio.operations.GatewayApiOperations :ivar gateway_certificate_authority: GatewayCertificateAuthorityOperations operations :vartype gateway_certificate_authority: - api_management_client.aio.operations.GatewayCertificateAuthorityOperations + azure.mgmt.apimanagement.aio.operations.GatewayCertificateAuthorityOperations :ivar group: GroupOperations operations - :vartype group: api_management_client.aio.operations.GroupOperations + :vartype group: azure.mgmt.apimanagement.aio.operations.GroupOperations :ivar group_user: GroupUserOperations operations - :vartype group_user: api_management_client.aio.operations.GroupUserOperations + :vartype group_user: azure.mgmt.apimanagement.aio.operations.GroupUserOperations :ivar identity_provider: IdentityProviderOperations operations - :vartype identity_provider: api_management_client.aio.operations.IdentityProviderOperations + :vartype identity_provider: azure.mgmt.apimanagement.aio.operations.IdentityProviderOperations :ivar issue: IssueOperations operations - :vartype issue: api_management_client.aio.operations.IssueOperations + :vartype issue: azure.mgmt.apimanagement.aio.operations.IssueOperations :ivar logger: LoggerOperations operations - :vartype logger: api_management_client.aio.operations.LoggerOperations + :vartype logger: azure.mgmt.apimanagement.aio.operations.LoggerOperations :ivar named_value: NamedValueOperations operations - :vartype named_value: api_management_client.aio.operations.NamedValueOperations + :vartype named_value: azure.mgmt.apimanagement.aio.operations.NamedValueOperations :ivar network_status: NetworkStatusOperations operations - :vartype network_status: api_management_client.aio.operations.NetworkStatusOperations + :vartype network_status: azure.mgmt.apimanagement.aio.operations.NetworkStatusOperations :ivar notification: NotificationOperations operations - :vartype notification: api_management_client.aio.operations.NotificationOperations + :vartype notification: azure.mgmt.apimanagement.aio.operations.NotificationOperations :ivar notification_recipient_user: NotificationRecipientUserOperations operations :vartype notification_recipient_user: - api_management_client.aio.operations.NotificationRecipientUserOperations + azure.mgmt.apimanagement.aio.operations.NotificationRecipientUserOperations :ivar notification_recipient_email: NotificationRecipientEmailOperations operations :vartype notification_recipient_email: - api_management_client.aio.operations.NotificationRecipientEmailOperations + azure.mgmt.apimanagement.aio.operations.NotificationRecipientEmailOperations :ivar open_id_connect_provider: OpenIdConnectProviderOperations operations :vartype open_id_connect_provider: - api_management_client.aio.operations.OpenIdConnectProviderOperations + azure.mgmt.apimanagement.aio.operations.OpenIdConnectProviderOperations :ivar outbound_network_dependencies_endpoints: OutboundNetworkDependenciesEndpointsOperations operations :vartype outbound_network_dependencies_endpoints: - api_management_client.aio.operations.OutboundNetworkDependenciesEndpointsOperations + azure.mgmt.apimanagement.aio.operations.OutboundNetworkDependenciesEndpointsOperations :ivar policy: PolicyOperations operations - :vartype policy: api_management_client.aio.operations.PolicyOperations + :vartype policy: azure.mgmt.apimanagement.aio.operations.PolicyOperations :ivar policy_description: PolicyDescriptionOperations operations - :vartype policy_description: api_management_client.aio.operations.PolicyDescriptionOperations + :vartype policy_description: + azure.mgmt.apimanagement.aio.operations.PolicyDescriptionOperations :ivar portal_revision: PortalRevisionOperations operations - :vartype portal_revision: api_management_client.aio.operations.PortalRevisionOperations + :vartype portal_revision: azure.mgmt.apimanagement.aio.operations.PortalRevisionOperations :ivar portal_settings: PortalSettingsOperations operations - :vartype portal_settings: api_management_client.aio.operations.PortalSettingsOperations + :vartype portal_settings: azure.mgmt.apimanagement.aio.operations.PortalSettingsOperations :ivar sign_in_settings: SignInSettingsOperations operations - :vartype sign_in_settings: api_management_client.aio.operations.SignInSettingsOperations + :vartype sign_in_settings: azure.mgmt.apimanagement.aio.operations.SignInSettingsOperations :ivar sign_up_settings: SignUpSettingsOperations operations - :vartype sign_up_settings: api_management_client.aio.operations.SignUpSettingsOperations + :vartype sign_up_settings: azure.mgmt.apimanagement.aio.operations.SignUpSettingsOperations :ivar delegation_settings: DelegationSettingsOperations operations - :vartype delegation_settings: api_management_client.aio.operations.DelegationSettingsOperations + :vartype delegation_settings: + azure.mgmt.apimanagement.aio.operations.DelegationSettingsOperations :ivar private_endpoint_connection: PrivateEndpointConnectionOperations operations :vartype private_endpoint_connection: - api_management_client.aio.operations.PrivateEndpointConnectionOperations + azure.mgmt.apimanagement.aio.operations.PrivateEndpointConnectionOperations :ivar product: ProductOperations operations - :vartype product: api_management_client.aio.operations.ProductOperations + :vartype product: azure.mgmt.apimanagement.aio.operations.ProductOperations :ivar product_api: ProductApiOperations operations - :vartype product_api: api_management_client.aio.operations.ProductApiOperations + :vartype product_api: azure.mgmt.apimanagement.aio.operations.ProductApiOperations :ivar product_group: ProductGroupOperations operations - :vartype product_group: api_management_client.aio.operations.ProductGroupOperations + :vartype product_group: azure.mgmt.apimanagement.aio.operations.ProductGroupOperations :ivar product_subscriptions: ProductSubscriptionsOperations operations :vartype product_subscriptions: - api_management_client.aio.operations.ProductSubscriptionsOperations + azure.mgmt.apimanagement.aio.operations.ProductSubscriptionsOperations :ivar product_policy: ProductPolicyOperations operations - :vartype product_policy: api_management_client.aio.operations.ProductPolicyOperations + :vartype product_policy: azure.mgmt.apimanagement.aio.operations.ProductPolicyOperations :ivar quota_by_counter_keys: QuotaByCounterKeysOperations operations :vartype quota_by_counter_keys: - api_management_client.aio.operations.QuotaByCounterKeysOperations + azure.mgmt.apimanagement.aio.operations.QuotaByCounterKeysOperations :ivar quota_by_period_keys: QuotaByPeriodKeysOperations operations - :vartype quota_by_period_keys: api_management_client.aio.operations.QuotaByPeriodKeysOperations + :vartype quota_by_period_keys: + azure.mgmt.apimanagement.aio.operations.QuotaByPeriodKeysOperations :ivar region: RegionOperations operations - :vartype region: api_management_client.aio.operations.RegionOperations + :vartype region: azure.mgmt.apimanagement.aio.operations.RegionOperations :ivar reports: ReportsOperations operations - :vartype reports: api_management_client.aio.operations.ReportsOperations + :vartype reports: azure.mgmt.apimanagement.aio.operations.ReportsOperations :ivar global_schema: GlobalSchemaOperations operations - :vartype global_schema: api_management_client.aio.operations.GlobalSchemaOperations + :vartype global_schema: azure.mgmt.apimanagement.aio.operations.GlobalSchemaOperations :ivar tenant_settings: TenantSettingsOperations operations - :vartype tenant_settings: api_management_client.aio.operations.TenantSettingsOperations + :vartype tenant_settings: azure.mgmt.apimanagement.aio.operations.TenantSettingsOperations :ivar api_management_skus: ApiManagementSkusOperations operations - :vartype api_management_skus: api_management_client.aio.operations.ApiManagementSkusOperations + :vartype api_management_skus: + azure.mgmt.apimanagement.aio.operations.ApiManagementSkusOperations :ivar subscription: SubscriptionOperations operations - :vartype subscription: api_management_client.aio.operations.SubscriptionOperations + :vartype subscription: azure.mgmt.apimanagement.aio.operations.SubscriptionOperations :ivar tag_resource: TagResourceOperations operations - :vartype tag_resource: api_management_client.aio.operations.TagResourceOperations + :vartype tag_resource: azure.mgmt.apimanagement.aio.operations.TagResourceOperations :ivar tenant_access: TenantAccessOperations operations - :vartype tenant_access: api_management_client.aio.operations.TenantAccessOperations + :vartype tenant_access: azure.mgmt.apimanagement.aio.operations.TenantAccessOperations :ivar tenant_access_git: TenantAccessGitOperations operations - :vartype tenant_access_git: api_management_client.aio.operations.TenantAccessGitOperations + :vartype tenant_access_git: azure.mgmt.apimanagement.aio.operations.TenantAccessGitOperations :ivar tenant_configuration: TenantConfigurationOperations operations :vartype tenant_configuration: - api_management_client.aio.operations.TenantConfigurationOperations + azure.mgmt.apimanagement.aio.operations.TenantConfigurationOperations :ivar user: UserOperations operations - :vartype user: api_management_client.aio.operations.UserOperations + :vartype user: azure.mgmt.apimanagement.aio.operations.UserOperations :ivar user_group: UserGroupOperations operations - :vartype user_group: api_management_client.aio.operations.UserGroupOperations + :vartype user_group: azure.mgmt.apimanagement.aio.operations.UserGroupOperations :ivar user_subscription: UserSubscriptionOperations operations - :vartype user_subscription: api_management_client.aio.operations.UserSubscriptionOperations + :vartype user_subscription: azure.mgmt.apimanagement.aio.operations.UserSubscriptionOperations :ivar user_identities: UserIdentitiesOperations operations - :vartype user_identities: api_management_client.aio.operations.UserIdentitiesOperations + :vartype user_identities: azure.mgmt.apimanagement.aio.operations.UserIdentitiesOperations :ivar user_confirmation_password: UserConfirmationPasswordOperations operations :vartype user_confirmation_password: - api_management_client.aio.operations.UserConfirmationPasswordOperations + azure.mgmt.apimanagement.aio.operations.UserConfirmationPasswordOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str - :param base_url: Service URL. Default value is 'https://management.azure.com'. + :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str + :keyword api_version: Api Version. Default value is "2021-08-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py index d049edf46f0a..457b5ff7ca64 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/_configuration.py @@ -19,7 +19,7 @@ from azure.core.credentials_async import AsyncTokenCredential -class ApiManagementClientConfiguration(Configuration): +class ApiManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for ApiManagementClient. Note that all parameters used to create this instance are saved as instance @@ -27,8 +27,12 @@ class ApiManagementClientConfiguration(Configuration): :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + :param subscription_id: Subscription credentials which uniquely identify Microsoft Azure + subscription. The subscription ID forms part of the URI for every service call. :type subscription_id: str + :keyword api_version: Api Version. Default value is "2021-08-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -38,6 +42,8 @@ def __init__( **kwargs: Any ) -> None: super(ApiManagementClientConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -45,7 +51,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-08-01" + self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-apimanagement/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py index 3f8528325697..23f9d7b83712 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_diagnostic_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiDiagnosticOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,19 +66,22 @@ def list_by_service( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DiagnosticCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.DiagnosticCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.DiagnosticCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -93,6 +95,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -108,6 +111,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -128,7 +132,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -142,7 +150,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -175,6 +183,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -182,12 +192,17 @@ async def get_entity_tag( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -203,7 +218,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async @@ -228,7 +243,7 @@ async def get( :type diagnostic_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -237,6 +252,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -244,12 +261,17 @@ async def get( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -267,7 +289,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async @@ -293,13 +315,13 @@ async def create_or_update( service instance. :type diagnostic_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -308,6 +330,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -318,6 +341,7 @@ async def create_or_update( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -326,7 +350,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -350,7 +378,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async @@ -379,10 +407,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Diagnostic Update parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -391,6 +419,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -401,6 +430,7 @@ async def update( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -409,7 +439,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -427,11 +461,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -465,6 +499,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -472,13 +508,18 @@ async def delete( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -489,5 +530,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py index d6cc0ff9af64..106025affe89 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_export_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class ApiExportOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,12 +65,12 @@ async def get( :type api_id: str :param format: Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. - :type format: str or ~api_management_client.models.ExportFormat + :type format: str or ~azure.mgmt.apimanagement.models.ExportFormat :param export: Query parameter required to export the API details. - :type export: str or ~api_management_client.models.ExportApi + :type export: str or ~azure.mgmt.apimanagement.models.ExportApi :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiExportResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiExportResult + :rtype: ~azure.mgmt.apimanagement.models.ApiExportResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiExportResult"] @@ -80,12 +79,15 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, export=export, template_url=self.get.metadata['url'], @@ -93,7 +95,11 @@ async def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -108,5 +114,5 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py index f6d4d34929c9..070ab00913b4 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_attachment_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiIssueAttachmentOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -72,19 +71,22 @@ def list_by_service( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueAttachmentCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.IssueAttachmentCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.IssueAttachmentCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueAttachmentCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -99,6 +101,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -115,6 +118,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -135,7 +139,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,7 +157,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -187,6 +195,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -195,12 +205,17 @@ async def get_entity_tag( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -216,7 +231,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore @distributed_trace_async @@ -245,7 +260,7 @@ async def get( :type attachment_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueAttachmentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueAttachmentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueAttachmentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueAttachmentContract"] @@ -254,6 +269,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -262,12 +279,17 @@ async def get( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -285,7 +307,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore @distributed_trace_async @@ -315,13 +337,13 @@ async def create_or_update( Issue. :type attachment_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IssueAttachmentContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueAttachmentContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueAttachmentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueAttachmentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueAttachmentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueAttachmentContract"] @@ -330,6 +352,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueAttachmentContract') @@ -341,6 +364,7 @@ async def create_or_update( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -349,7 +373,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -373,11 +401,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -415,6 +443,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -423,13 +453,18 @@ async def delete( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -440,5 +475,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py index a47be54189f9..d176e560b4c8 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_comment_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiIssueCommentOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -72,19 +71,22 @@ def list_by_service( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueCommentCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.IssueCommentCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.IssueCommentCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCommentCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -99,6 +101,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -115,6 +118,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -135,7 +139,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,7 +157,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -186,6 +194,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -194,12 +204,17 @@ async def get_entity_tag( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -215,7 +230,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore @distributed_trace_async @@ -243,7 +258,7 @@ async def get( :type comment_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueCommentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueCommentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueCommentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCommentContract"] @@ -252,6 +267,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -260,12 +277,17 @@ async def get( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -283,7 +305,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore @distributed_trace_async @@ -312,13 +334,13 @@ async def create_or_update( :param comment_id: Comment identifier within an Issue. Must be unique in the current Issue. :type comment_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IssueCommentContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueCommentContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueCommentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueCommentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueCommentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCommentContract"] @@ -327,6 +349,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueCommentContract') @@ -338,6 +361,7 @@ async def create_or_update( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -346,7 +370,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -370,11 +398,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -411,6 +439,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -419,13 +449,18 @@ async def delete( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -436,5 +471,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py index 0f9ba2e907af..776bd12607cf 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_issue_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiIssueOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -70,19 +69,22 @@ def list_by_service( 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 | |
. + filter | eq | |
. Default value is None. :type filter: str - :param expand_comments_attachments: Expand the comment attachments. + :param expand_comments_attachments: Expand the comment attachments. Default value is None. :type expand_comments_attachments: bool - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.IssueCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.IssueCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -96,6 +98,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, expand_comments_attachments=expand_comments_attachments, top=top, @@ -112,6 +115,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, expand_comments_attachments=expand_comments_attachments, top=top, @@ -133,7 +137,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -147,7 +155,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -180,6 +188,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -187,12 +197,17 @@ async def get_entity_tag( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -208,7 +223,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace_async @@ -232,11 +247,11 @@ async def get( :param issue_id: Issue identifier. Must be unique in the current API Management service instance. :type issue_id: str - :param expand_comments_attachments: Expand the comment attachments. + :param expand_comments_attachments: Expand the comment attachments. Default value is None. :type expand_comments_attachments: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -245,6 +260,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -252,13 +269,18 @@ async def get( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, expand_comments_attachments=expand_comments_attachments, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -276,7 +298,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace_async @@ -302,13 +324,13 @@ async def create_or_update( instance. :type issue_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IssueContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -317,6 +339,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueContract') @@ -327,6 +350,7 @@ async def create_or_update( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -335,7 +359,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -359,7 +387,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace_async @@ -388,10 +416,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.IssueUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -400,6 +428,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueUpdateContract') @@ -410,6 +439,7 @@ async def update( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -418,7 +448,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -436,11 +470,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -474,6 +508,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -481,13 +517,18 @@ async def delete( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -498,5 +539,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_client_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_client_operations.py index 02126185a7f2..10c32efcbb19 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_client_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_client_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -39,6 +38,7 @@ async def _perform_connectivity_check_async_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(connectivity_check_request_params, 'ConnectivityCheckRequest') @@ -47,6 +47,7 @@ async def _perform_connectivity_check_async_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._perform_connectivity_check_async_initial.metadata['url'], @@ -54,7 +55,11 @@ async def _perform_connectivity_check_async_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -70,7 +75,7 @@ async def _perform_connectivity_check_async_initial( return deserialized - _perform_connectivity_check_async_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck'} # type: ignore + _perform_connectivity_check_async_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck"} # type: ignore @distributed_trace_async @@ -89,7 +94,8 @@ async def begin_perform_connectivity_check_async( :param service_name: The name of the API Management service. :type service_name: str :param connectivity_check_request_params: Connectivity Check request parameters. - :type connectivity_check_request_params: ~api_management_client.models.ConnectivityCheckRequest + :type connectivity_check_request_params: + ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -101,11 +107,12 @@ async def begin_perform_connectivity_check_async( :return: An instance of AsyncLROPoller that returns either ConnectivityCheckResponse or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ConnectivityCheckResponse] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ConnectivityCheckResponse] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityCheckResponse"] lro_delay = kwargs.pop( 'polling_interval', @@ -117,6 +124,7 @@ async def begin_perform_connectivity_check_async( resource_group_name=resource_group_name, service_name=service_name, connectivity_check_request_params=connectivity_check_request_params, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -141,7 +149,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_perform_connectivity_check_async.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck'} # type: ignore + begin_perform_connectivity_check_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py index 4956b9c0c9b0..9dbba9f36986 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_operations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class ApiManagementOperationsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -56,9 +54,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.OperationListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -68,6 +68,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -76,6 +77,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -93,7 +95,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -107,4 +113,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.ApiManagement/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.ApiManagement/operations"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py index 7f87d5411907..6fd424bc2629 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class ApiManagementServiceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,6 +60,7 @@ async def _restore_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceBackupRestoreParameters') @@ -69,6 +69,7 @@ async def _restore_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._restore_initial.metadata['url'], @@ -76,7 +77,11 @@ async def _restore_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -92,7 +97,7 @@ async def _restore_initial( return deserialized - _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore'} # type: ignore + _restore_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore"} # type: ignore @distributed_trace_async @@ -113,7 +118,7 @@ async def begin_restore( :type service_name: str :param parameters: Parameters supplied to the Restore API Management service from backup operation. - :type parameters: ~api_management_client.models.ApiManagementServiceBackupRestoreParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceBackupRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -125,11 +130,12 @@ async def begin_restore( :return: An instance of AsyncLROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -141,6 +147,7 @@ async def begin_restore( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -165,10 +172,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore'} # type: ignore + begin_restore.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore"} # type: ignore async def _backup_initial( self, @@ -183,6 +189,7 @@ async def _backup_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceBackupRestoreParameters') @@ -191,6 +198,7 @@ async def _backup_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._backup_initial.metadata['url'], @@ -198,7 +206,11 @@ async def _backup_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -214,7 +226,7 @@ async def _backup_initial( return deserialized - _backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup'} # type: ignore + _backup_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup"} # type: ignore @distributed_trace_async @@ -233,7 +245,7 @@ async def begin_backup( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Parameters supplied to the ApiManagementService_Backup operation. - :type parameters: ~api_management_client.models.ApiManagementServiceBackupRestoreParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceBackupRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -245,11 +257,12 @@ async def begin_backup( :return: An instance of AsyncLROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -261,6 +274,7 @@ async def begin_backup( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -285,10 +299,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup'} # type: ignore + begin_backup.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup"} # type: ignore async def _create_or_update_initial( self, @@ -303,6 +316,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceResource') @@ -311,6 +325,7 @@ async def _create_or_update_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -318,7 +333,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -337,7 +356,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace_async @@ -356,7 +375,7 @@ async def begin_create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Parameters supplied to the CreateOrUpdate API Management service operation. - :type parameters: ~api_management_client.models.ApiManagementServiceResource + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -368,11 +387,12 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -384,6 +404,7 @@ async def begin_create_or_update( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -408,10 +429,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore async def _update_initial( self, @@ -426,6 +446,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceUpdateParameters') @@ -434,6 +455,7 @@ async def _update_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -441,7 +463,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -457,7 +483,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace_async @@ -475,7 +501,7 @@ async def begin_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Parameters supplied to the CreateOrUpdate API Management service operation. - :type parameters: ~api_management_client.models.ApiManagementServiceUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -487,11 +513,12 @@ async def begin_update( :return: An instance of AsyncLROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -503,6 +530,7 @@ async def begin_update( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -527,10 +555,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace_async async def get( @@ -547,7 +574,7 @@ async def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceResource, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceResource + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] @@ -556,17 +583,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -581,7 +615,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore async def _delete_initial( @@ -596,17 +630,24 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -622,7 +663,7 @@ async def _delete_initial( return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace_async @@ -649,10 +690,11 @@ async def begin_delete( :return: An instance of AsyncLROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -663,6 +705,7 @@ async def begin_delete( raw_result = await self._delete_initial( resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -686,10 +729,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -705,9 +747,11 @@ def list_by_resource_group( :return: An iterator like instance of either ApiManagementServiceListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiManagementServiceListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiManagementServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -719,6 +763,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_resource_group.metadata['url'], ) request = _convert_request(request) @@ -729,6 +774,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -746,7 +792,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -760,7 +810,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service"} # type: ignore @distributed_trace def list( @@ -773,9 +823,11 @@ def list( :return: An iterator like instance of either ApiManagementServiceListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiManagementServiceListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiManagementServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -786,6 +838,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -795,6 +848,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -812,7 +866,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -826,7 +884,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service"} # type: ignore @distributed_trace_async async def get_sso_token( @@ -843,7 +901,7 @@ async def get_sso_token( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceGetSsoTokenResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceGetSsoTokenResult + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceGetSsoTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceGetSsoTokenResult"] @@ -852,17 +910,24 @@ async def get_sso_token( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_sso_token_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_sso_token.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -877,7 +942,7 @@ async def get_sso_token( return deserialized - get_sso_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken'} # type: ignore + get_sso_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken"} # type: ignore @distributed_trace_async @@ -890,10 +955,10 @@ async def check_name_availability( :param parameters: Parameters supplied to the CheckNameAvailability operation. :type parameters: - ~api_management_client.models.ApiManagementServiceCheckNameAvailabilityParameters + ~azure.mgmt.apimanagement.models.ApiManagementServiceCheckNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceNameAvailabilityResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceNameAvailabilityResult + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceNameAvailabilityResult"] @@ -902,12 +967,14 @@ async def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceCheckNameAvailabilityParameters') request = build_check_name_availability_request( subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -915,7 +982,11 @@ async def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -930,7 +1001,7 @@ async def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability"} # type: ignore @distributed_trace_async @@ -942,7 +1013,7 @@ async def get_domain_ownership_identifier( :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceGetDomainOwnershipIdentifierResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceGetDomainOwnershipIdentifierResult + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceGetDomainOwnershipIdentifierResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceGetDomainOwnershipIdentifierResult"] @@ -951,15 +1022,22 @@ async def get_domain_ownership_identifier( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_domain_ownership_identifier_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_domain_ownership_identifier.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -974,7 +1052,7 @@ async def get_domain_ownership_identifier( return deserialized - get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier'} # type: ignore + get_domain_ownership_identifier.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier"} # type: ignore async def _apply_network_configuration_updates_initial( @@ -990,6 +1068,7 @@ async def _apply_network_configuration_updates_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if parameters is not None: @@ -1001,6 +1080,7 @@ async def _apply_network_configuration_updates_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._apply_network_configuration_updates_initial.metadata['url'], @@ -1008,7 +1088,11 @@ async def _apply_network_configuration_updates_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1024,7 +1108,7 @@ async def _apply_network_configuration_updates_initial( return deserialized - _apply_network_configuration_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates'} # type: ignore + _apply_network_configuration_updates_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates"} # type: ignore @distributed_trace_async @@ -1044,9 +1128,9 @@ async def begin_apply_network_configuration_updates( :type service_name: str :param parameters: Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which the Api Management service is deployed will be - updated sequentially without incurring downtime in the region. + updated sequentially without incurring downtime in the region. Default value is None. :type parameters: - ~api_management_client.models.ApiManagementServiceApplyNetworkConfigurationParameters + ~azure.mgmt.apimanagement.models.ApiManagementServiceApplyNetworkConfigurationParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -1058,11 +1142,12 @@ async def begin_apply_network_configuration_updates( :return: An instance of AsyncLROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -1074,6 +1159,7 @@ async def begin_apply_network_configuration_updates( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1098,7 +1184,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_apply_network_configuration_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates'} # type: ignore + begin_apply_network_configuration_updates.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py index ffa3b8210fe2..f735b62d8bf5 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_service_skus_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class ApiManagementServiceSkusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,9 +62,11 @@ def list_available_service_skus( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSkuResults or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ResourceSkuResults] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ResourceSkuResults] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkuResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -79,6 +79,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_available_service_skus.metadata['url'], ) request = _convert_request(request) @@ -90,6 +91,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -107,7 +109,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -121,4 +127,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_available_service_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus'} # type: ignore + list_available_service_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py index b01df3ab7be6..56bb80496c70 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_management_skus_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class ApiManagementSkusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -57,9 +55,11 @@ def list( :return: An iterator like instance of either ApiManagementSkusResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiManagementSkusResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiManagementSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -70,6 +70,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -79,6 +80,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -96,7 +98,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -110,4 +116,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py index 395d99437277..0033cfc1a6b1 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiOperationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -74,20 +73,22 @@ def list_by_api( |
| 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 | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
. + startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param tags: Include tags in the response. + :param tags: Include tags in the response. Default value is None. :type tags: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.OperationCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.OperationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -101,6 +102,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -117,6 +119,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -138,7 +141,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -152,7 +159,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -186,6 +193,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -193,12 +202,17 @@ async def get_entity_tag( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -214,7 +228,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace_async @@ -240,7 +254,7 @@ async def get( :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) - :rtype: ~api_management_client.models.OperationContract + :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] @@ -249,6 +263,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -256,12 +272,17 @@ async def get( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -279,7 +300,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace_async @@ -306,13 +327,13 @@ async def create_or_update( Management service instance. :type operation_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.OperationContract + :type parameters: ~azure.mgmt.apimanagement.models.OperationContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) - :rtype: ~api_management_client.models.OperationContract + :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] @@ -321,6 +342,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OperationContract') @@ -331,6 +353,7 @@ async def create_or_update( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -339,7 +362,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -363,7 +390,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace_async @@ -393,10 +420,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: API Operation Update parameters. - :type parameters: ~api_management_client.models.OperationUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.OperationUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) - :rtype: ~api_management_client.models.OperationContract + :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] @@ -405,6 +432,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OperationUpdateContract') @@ -415,6 +443,7 @@ async def update( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -423,7 +452,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -441,11 +474,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -480,6 +513,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -487,13 +522,18 @@ async def delete( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -504,5 +544,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py index 7e6412805954..c475bfe6e7db 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operation_policy_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class ApiOperationPolicyOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,7 +66,7 @@ async def list_by_operation( :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -76,6 +75,8 @@ async def list_by_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_operation_request( resource_group_name=resource_group_name, @@ -83,12 +84,17 @@ async def list_by_operation( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -103,7 +109,7 @@ async def list_by_operation( return deserialized - list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies'} # type: ignore + list_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies"} # type: ignore @distributed_trace_async @@ -129,7 +135,7 @@ async def get_entity_tag( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -141,6 +147,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -149,12 +157,17 @@ async def get_entity_tag( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -170,7 +183,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -197,12 +210,12 @@ async def get( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -211,6 +224,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -219,13 +234,18 @@ async def get( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -243,7 +263,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -271,15 +291,15 @@ async def create_or_update( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -288,6 +308,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -299,6 +320,7 @@ async def create_or_update( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -307,7 +329,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -331,11 +357,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -358,7 +384,7 @@ async def delete( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -373,6 +399,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -381,13 +409,18 @@ async def delete( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -398,5 +431,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py index 5ea1c9ae2f80..da0d6d5e0008 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class ApiOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -73,21 +72,24 @@ def list_by_service( |
| 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 |
| isCurrent | filter | eq, ne | |
. + startswith, endswith |
| isCurrent | filter | eq, ne | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param tags: Include tags in the response. + :param tags: Include tags in the response. Default value is None. :type tags: str - :param expand_api_version_set: Include full ApiVersionSet resource in response. + :param expand_api_version_set: Include full ApiVersionSet resource in response. Default value + is None. :type expand_api_version_set: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -100,6 +102,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -116,6 +119,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -138,7 +142,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -152,7 +160,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -182,18 +190,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -209,7 +224,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace_async @@ -231,7 +246,7 @@ async def get( :type api_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -240,18 +255,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -269,7 +291,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore async def _create_or_update_initial( @@ -287,6 +309,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiCreateOrUpdateParameter') @@ -296,6 +319,7 @@ async def _create_or_update_initial( service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -304,7 +328,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -328,7 +356,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace_async @@ -351,9 +379,9 @@ async def begin_create_or_update( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.ApiCreateOrUpdateParameter + :type parameters: ~azure.mgmt.apimanagement.models.ApiCreateOrUpdateParameter :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -365,11 +393,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ApiContract or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~api_management_client.models.ApiContract] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.ApiContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -383,6 +412,7 @@ async def begin_create_or_update( api_id=api_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -410,10 +440,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace_async async def update( @@ -438,10 +467,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: API Update Contract parameters. - :type parameters: ~api_management_client.models.ApiUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -450,6 +479,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiUpdateContract') @@ -459,6 +489,7 @@ async def update( service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -467,7 +498,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -485,11 +520,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -510,7 +545,7 @@ async def delete( :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 delete_revisions: Delete all revisions of the Api. + :param delete_revisions: Delete all revisions of the Api. Default value is None. :type delete_revisions: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -523,12 +558,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, delete_revisions=delete_revisions, template_url=self.delete.metadata['url'], @@ -536,7 +574,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -547,7 +589,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace @@ -575,21 +617,24 @@ def list_by_tags( 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 | |
. + contains, startswith, endswith |
| isCurrent | filter | eq | |
. Default value is + None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param include_not_tagged_apis: Include not tagged APIs. + :param include_not_tagged_apis: Include not tagged APIs. Default value is None. :type include_not_tagged_apis: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagResourceCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -602,6 +647,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -617,6 +663,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -638,7 +685,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -652,4 +703,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags'} # type: ignore + list_by_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py index 7468a5351c07..839d0a320a7b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_policy_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class ApiPolicyOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,7 +62,7 @@ async def list_by_api( :type api_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -72,18 +71,25 @@ async def list_by_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_api_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -98,7 +104,7 @@ async def list_by_api( return deserialized - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies"} # type: ignore @distributed_trace_async @@ -120,7 +126,7 @@ async def get_entity_tag( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -132,6 +138,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -139,12 +147,17 @@ async def get_entity_tag( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -160,7 +173,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -183,12 +196,12 @@ async def get( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -197,6 +210,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -204,13 +219,18 @@ async def get( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 200]: @@ -234,7 +254,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -258,15 +278,15 @@ async def create_or_update( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -275,6 +295,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -285,6 +306,7 @@ async def create_or_update( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -293,7 +315,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -317,11 +343,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -340,7 +366,7 @@ async def delete( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -355,6 +381,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -362,13 +390,18 @@ async def delete( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -379,5 +412,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py index 4115220ddd94..5c34b139a8d9 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_product_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class ApiProductOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,18 +65,21 @@ def list_by_apis( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName - | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ProductCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ProductCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -92,6 +93,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -107,6 +109,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -127,7 +130,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,4 +148,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_apis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products'} # type: ignore + list_by_apis.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py index ee7535134d3f..e23081382200 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_release_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiReleaseOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -69,19 +68,22 @@ def list_by_service( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| notes | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiReleaseCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiReleaseCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiReleaseCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -95,6 +97,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -110,6 +113,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -130,7 +134,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -144,7 +152,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -177,6 +185,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -184,12 +194,17 @@ async def get_entity_tag( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -205,7 +220,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace_async @@ -230,7 +245,7 @@ async def get( :type release_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiReleaseContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiReleaseContract + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseContract"] @@ -239,6 +254,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -246,12 +263,17 @@ async def get( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -269,7 +291,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace_async @@ -295,13 +317,13 @@ async def create_or_update( Management service instance. :type release_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.ApiReleaseContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiReleaseContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiReleaseContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiReleaseContract + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseContract"] @@ -310,6 +332,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiReleaseContract') @@ -320,6 +343,7 @@ async def create_or_update( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -328,7 +352,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -352,7 +380,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace_async @@ -381,10 +409,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: API Release Update parameters. - :type parameters: ~api_management_client.models.ApiReleaseContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiReleaseContract :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiReleaseContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiReleaseContract + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseContract"] @@ -393,6 +421,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiReleaseContract') @@ -403,6 +432,7 @@ async def update( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -411,7 +441,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -429,11 +463,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -467,6 +501,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -474,13 +510,18 @@ async def delete( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -491,5 +532,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py index 4dd25937a47b..2b5d7710ee40 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_revision_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class ApiRevisionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,19 +65,22 @@ def list_by_service( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiRevision - | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiRevisionCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiRevisionCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiRevisionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiRevisionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -93,6 +94,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -108,6 +110,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -128,7 +131,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -142,4 +149,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py index 6f7c5b8ddc6b..a306b7f8c6f7 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_schema_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class ApiSchemaOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -70,17 +69,21 @@ def list_by_api( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| contentType - | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SchemaCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.SchemaCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.SchemaCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SchemaCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -94,6 +97,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -109,6 +113,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -129,7 +134,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -143,7 +152,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -177,6 +186,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -184,12 +195,17 @@ async def get_entity_tag( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -205,7 +221,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore @distributed_trace_async @@ -231,7 +247,7 @@ async def get( :type schema_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SchemaContract, or the result of cls(response) - :rtype: ~api_management_client.models.SchemaContract + :rtype: ~azure.mgmt.apimanagement.models.SchemaContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SchemaContract"] @@ -240,6 +256,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -247,12 +265,17 @@ async def get( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -270,7 +293,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore async def _create_or_update_initial( @@ -289,6 +312,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SchemaContract') @@ -299,6 +323,7 @@ async def _create_or_update_initial( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -307,7 +332,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -331,7 +360,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore @distributed_trace_async @@ -358,9 +387,9 @@ async def begin_create_or_update( instance. :type schema_id: str :param parameters: The schema contents to apply. - :type parameters: ~api_management_client.models.SchemaContract + :type parameters: ~azure.mgmt.apimanagement.models.SchemaContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -372,11 +401,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either SchemaContract or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~api_management_client.models.SchemaContract] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.SchemaContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.SchemaContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -391,6 +421,7 @@ async def begin_create_or_update( schema_id=schema_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -418,13 +449,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -449,7 +479,8 @@ async def delete( :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 force: If true removes all references to the schema before deleting it. + :param force: If true removes all references to the schema before deleting it. Default value is + None. :type force: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -462,6 +493,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -469,6 +502,7 @@ async def delete( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, force=force, template_url=self.delete.metadata['url'], @@ -476,7 +510,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -487,5 +525,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py index 9131ad1cfb64..12416c794bfc 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_tag_description_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiTagDescriptionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -70,19 +69,22 @@ def list_by_service( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagDescriptionCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagDescriptionCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagDescriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagDescriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -96,6 +98,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -111,6 +114,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -131,7 +135,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -145,7 +153,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -179,6 +187,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -186,12 +196,17 @@ async def get_entity_tag( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -207,7 +222,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore @distributed_trace_async @@ -233,7 +248,7 @@ async def get( :type tag_description_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagDescriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagDescriptionContract + :rtype: ~azure.mgmt.apimanagement.models.TagDescriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagDescriptionContract"] @@ -242,6 +257,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -249,12 +266,17 @@ async def get( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -272,7 +294,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore @distributed_trace_async @@ -299,13 +321,13 @@ async def create_or_update( API/Tag association. Based on API and Tag names. :type tag_description_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.TagDescriptionCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.TagDescriptionCreateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagDescriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagDescriptionContract + :rtype: ~azure.mgmt.apimanagement.models.TagDescriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagDescriptionContract"] @@ -314,6 +336,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'TagDescriptionCreateParameters') @@ -324,6 +347,7 @@ async def create_or_update( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -332,7 +356,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -356,11 +384,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -395,6 +423,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -402,13 +432,18 @@ async def delete( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -419,5 +454,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py index 90112d0b71c8..b9729232e5ab 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_api_version_set_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ApiVersionSetOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,19 +62,22 @@ def list_by_service( :param service_name: The name of the API Management service. :type service_name: str :param filter: | Field | Usage | Supported operators | Supported - functions |
|-------------|-------------|-------------|-------------|
. + functions |
|-------------|-------------|-------------|-------------|
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiVersionSetCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiVersionSetCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiVersionSetCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -88,6 +90,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -102,6 +105,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -122,7 +126,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -136,7 +144,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -166,18 +174,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -193,7 +208,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace_async @@ -215,7 +230,7 @@ async def get( :type version_set_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiVersionSetContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiVersionSetContract + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetContract"] @@ -224,18 +239,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -253,7 +275,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace_async @@ -276,13 +298,13 @@ async def create_or_update( service instance. :type version_set_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.ApiVersionSetContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiVersionSetContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiVersionSetContract + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetContract"] @@ -291,6 +313,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiVersionSetContract') @@ -300,6 +323,7 @@ async def create_or_update( service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -308,7 +332,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -332,7 +360,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace_async @@ -358,10 +386,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.ApiVersionSetUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiVersionSetUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiVersionSetContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiVersionSetContract + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetContract"] @@ -370,6 +398,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiVersionSetUpdateParameters') @@ -379,6 +408,7 @@ async def update( service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -387,7 +417,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -405,11 +439,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -440,19 +474,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -463,5 +504,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py index bbb4dffb2662..3613a0abb179 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_authorization_server_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class AuthorizationServerOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,19 +65,21 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AuthorizationServerCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.AuthorizationServerCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.AuthorizationServerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -91,6 +92,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -105,6 +107,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -125,7 +128,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -168,18 +175,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -195,7 +209,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace_async @@ -216,7 +230,7 @@ async def get( :type authsid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerContract"] @@ -225,18 +239,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -254,7 +275,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace_async @@ -276,13 +297,13 @@ async def create_or_update( :param authsid: Identifier of the authorization server. :type authsid: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.AuthorizationServerContract + :type parameters: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerContract"] @@ -291,6 +312,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AuthorizationServerContract') @@ -300,6 +322,7 @@ async def create_or_update( service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -308,7 +331,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -332,7 +359,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace_async @@ -357,10 +384,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: OAuth2 Server settings Update parameters. - :type parameters: ~api_management_client.models.AuthorizationServerUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.AuthorizationServerUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerContract"] @@ -369,6 +396,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AuthorizationServerUpdateContract') @@ -378,6 +406,7 @@ async def update( service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -386,7 +415,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -404,11 +437,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -438,19 +471,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -461,7 +501,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace_async @@ -482,7 +522,7 @@ async def list_secrets( :type authsid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerSecretsContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerSecretsContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerSecretsContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerSecretsContract"] @@ -491,18 +531,25 @@ async def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -520,5 +567,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py index 75335b4c780d..69b5ba0f9db9 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_backend_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class BackendOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,18 +65,21 @@ def list_by_service( 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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BackendCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.BackendCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.BackendCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -90,6 +92,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -104,6 +107,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -124,7 +128,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -138,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -168,18 +176,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -195,7 +210,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace_async @@ -217,7 +232,7 @@ async def get( :type backend_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BackendContract, or the result of cls(response) - :rtype: ~api_management_client.models.BackendContract + :rtype: ~azure.mgmt.apimanagement.models.BackendContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendContract"] @@ -226,18 +241,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -255,7 +277,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace_async @@ -278,13 +300,13 @@ async def create_or_update( Management service instance. :type backend_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.BackendContract + :type parameters: ~azure.mgmt.apimanagement.models.BackendContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BackendContract, or the result of cls(response) - :rtype: ~api_management_client.models.BackendContract + :rtype: ~azure.mgmt.apimanagement.models.BackendContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendContract"] @@ -293,6 +315,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'BackendContract') @@ -302,6 +325,7 @@ async def create_or_update( service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -310,7 +334,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -334,7 +362,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace_async @@ -360,10 +388,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.BackendUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.BackendUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: BackendContract, or the result of cls(response) - :rtype: ~api_management_client.models.BackendContract + :rtype: ~azure.mgmt.apimanagement.models.BackendContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendContract"] @@ -372,6 +400,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'BackendUpdateParameters') @@ -381,6 +410,7 @@ async def update( service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -389,7 +419,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -407,11 +441,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -442,19 +476,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -465,11 +506,11 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace_async - async def reconnect( + async def reconnect( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -487,8 +528,8 @@ async def reconnect( :param backend_id: Identifier of the Backend entity. Must be unique in the current API Management service instance. :type backend_id: str - :param parameters: Reconnect request parameters. - :type parameters: ~api_management_client.models.BackendReconnectContract + :param parameters: Reconnect request parameters. Default value is None. + :type parameters: ~azure.mgmt.apimanagement.models.BackendReconnectContract :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -500,6 +541,7 @@ async def reconnect( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if parameters is not None: @@ -512,6 +554,7 @@ async def reconnect( service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.reconnect.metadata['url'], @@ -519,7 +562,11 @@ async def reconnect( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -530,5 +577,5 @@ async def reconnect( if cls: return cls(pipeline_response, None, {}) - reconnect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect'} # type: ignore + reconnect.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py index 4d89b755ee3b..d7c9a11dbce2 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_cache_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class CacheOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,15 +60,18 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CacheCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.CacheCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.CacheCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -82,6 +84,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=self.list_by_service.metadata['url'], @@ -95,6 +98,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=next_link, @@ -114,7 +118,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -128,7 +136,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -158,18 +166,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -185,7 +200,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace_async @@ -207,7 +222,7 @@ async def get( :type cache_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CacheContract, or the result of cls(response) - :rtype: ~api_management_client.models.CacheContract + :rtype: ~azure.mgmt.apimanagement.models.CacheContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheContract"] @@ -216,18 +231,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -245,7 +267,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace_async @@ -268,13 +290,13 @@ async def create_or_update( or valid Azure region identifier). :type cache_id: str :param parameters: Create or Update parameters. - :type parameters: ~api_management_client.models.CacheContract + :type parameters: ~azure.mgmt.apimanagement.models.CacheContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CacheContract, or the result of cls(response) - :rtype: ~api_management_client.models.CacheContract + :rtype: ~azure.mgmt.apimanagement.models.CacheContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheContract"] @@ -283,6 +305,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'CacheContract') @@ -292,6 +315,7 @@ async def create_or_update( service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -300,7 +324,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -324,7 +352,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace_async @@ -350,10 +378,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.CacheUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.CacheUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: CacheContract, or the result of cls(response) - :rtype: ~api_management_client.models.CacheContract + :rtype: ~azure.mgmt.apimanagement.models.CacheContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheContract"] @@ -362,6 +390,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'CacheUpdateParameters') @@ -371,6 +400,7 @@ async def update( service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -379,7 +409,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -397,11 +431,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -432,19 +466,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -455,5 +496,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py index ab26b2c72737..d38aa9a7c71c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_certificate_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class CertificateOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,22 +67,24 @@ def list_by_service( filter | ge, le, eq, ne, gt, lt | substringof, contains, 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 | |
. + |
| expirationDate | filter | ge, le, eq, ne, gt, lt | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :param is_key_vault_refresh_failed: When set to true, the response contains only certificates - entities which failed refresh. + entities which failed refresh. Default value is None. :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.CertificateCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.CertificateCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -96,6 +97,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -111,6 +113,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -132,7 +135,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -146,7 +153,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -176,18 +183,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -203,7 +217,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace_async @@ -225,7 +239,7 @@ async def get( :type certificate_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateContract, or the result of cls(response) - :rtype: ~api_management_client.models.CertificateContract + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] @@ -234,18 +248,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -263,7 +284,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace_async @@ -286,13 +307,13 @@ async def create_or_update( Management service instance. :type certificate_id: str :param parameters: Create or Update parameters. - :type parameters: ~api_management_client.models.CertificateCreateOrUpdateParameters + :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateContract, or the result of cls(response) - :rtype: ~api_management_client.models.CertificateContract + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] @@ -301,6 +322,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'CertificateCreateOrUpdateParameters') @@ -310,6 +332,7 @@ async def create_or_update( service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -318,7 +341,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -342,11 +369,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -377,19 +404,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -400,7 +434,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace_async @@ -422,7 +456,7 @@ async def refresh_secret( :type certificate_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateContract, or the result of cls(response) - :rtype: ~api_management_client.models.CertificateContract + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] @@ -431,18 +465,25 @@ async def refresh_secret( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_refresh_secret_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.refresh_secret.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -460,5 +501,5 @@ async def refresh_secret( return deserialized - refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret'} # type: ignore + refresh_secret.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py index 4a2398e809da..33660016fbe3 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_item_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ContentItemOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,9 +65,11 @@ def list_by_service( :return: An iterator like instance of either ContentItemCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ContentItemCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ContentItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentItemCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -82,6 +83,7 @@ def prepare_request(next_link=None): service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -94,6 +96,7 @@ def prepare_request(next_link=None): service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -111,7 +114,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -125,7 +132,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -158,6 +165,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -165,12 +174,17 @@ async def get_entity_tag( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -186,7 +200,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore @distributed_trace_async @@ -210,7 +224,7 @@ async def get( :type content_item_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentItemContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentItemContract + :rtype: ~azure.mgmt.apimanagement.models.ContentItemContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentItemContract"] @@ -219,6 +233,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -226,12 +242,17 @@ async def get( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -249,7 +270,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore @distributed_trace_async @@ -273,11 +294,11 @@ async def create_or_update( :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentItemContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentItemContract + :rtype: ~azure.mgmt.apimanagement.models.ContentItemContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentItemContract"] @@ -286,6 +307,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -293,13 +316,18 @@ async def create_or_update( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -323,11 +351,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -360,6 +388,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -367,13 +397,18 @@ async def delete( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -384,5 +419,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py index 1585a8e5ad8b..97cf13a36124 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_content_type_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ContentTypeOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,9 +63,11 @@ def list_by_service( :return: An iterator like instance of either ContentTypeCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ContentTypeCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ContentTypeCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentTypeCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -79,6 +80,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -90,6 +92,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -107,7 +110,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -121,7 +128,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes"} # type: ignore @distributed_trace_async async def get( @@ -142,7 +149,7 @@ async def get( :type content_type_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentTypeContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentTypeContract + :rtype: ~azure.mgmt.apimanagement.models.ContentTypeContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentTypeContract"] @@ -151,18 +158,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -180,7 +194,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}"} # type: ignore @distributed_trace_async @@ -203,11 +217,11 @@ async def create_or_update( :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentTypeContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentTypeContract + :rtype: ~azure.mgmt.apimanagement.models.ContentTypeContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentTypeContract"] @@ -216,19 +230,26 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -252,11 +273,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -288,19 +309,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -311,5 +339,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py index 46526b90ade2..4ca93b844074 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_delegation_settings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class DelegationSettingsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,17 +67,24 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -94,7 +100,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace_async @@ -112,7 +118,7 @@ async def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalDelegationSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalDelegationSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalDelegationSettings"] @@ -121,17 +127,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,11 +162,11 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace_async - async def update( + async def update( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -171,7 +184,7 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update Delegation settings. - :type parameters: ~api_management_client.models.PortalDelegationSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -183,6 +196,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalDelegationSettings') @@ -191,6 +205,7 @@ async def update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -199,7 +214,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -210,7 +229,7 @@ async def update( if cls: return cls(pipeline_response, None, {}) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace_async @@ -229,13 +248,13 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.PortalDelegationSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalDelegationSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalDelegationSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalDelegationSettings"] @@ -244,6 +263,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalDelegationSettings') @@ -252,6 +272,7 @@ async def create_or_update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -260,7 +281,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -275,7 +300,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace_async @@ -293,7 +318,7 @@ async def list_secrets( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSettingValidationKeyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSettingValidationKeyContract + :rtype: ~azure.mgmt.apimanagement.models.PortalSettingValidationKeyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSettingValidationKeyContract"] @@ -302,17 +327,24 @@ async def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -327,5 +359,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py index f8fc7ea2823a..3e9d555604e6 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_deleted_services_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class DeletedServicesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,9 +58,11 @@ def list_by_subscription( :return: An iterator like instance of either DeletedServicesCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.DeletedServicesCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.DeletedServicesCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServicesCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -72,6 +73,7 @@ def prepare_request(next_link=None): request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_subscription.metadata['url'], ) request = _convert_request(request) @@ -81,6 +83,7 @@ def prepare_request(next_link=None): request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -98,7 +101,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -112,7 +119,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices"} # type: ignore @distributed_trace_async async def get_by_name( @@ -129,7 +136,7 @@ async def get_by_name( :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeletedServiceContract, or the result of cls(response) - :rtype: ~api_management_client.models.DeletedServiceContract + :rtype: ~azure.mgmt.apimanagement.models.DeletedServiceContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServiceContract"] @@ -138,17 +145,24 @@ async def get_by_name( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_name_request( service_name=service_name, subscription_id=self._config.subscription_id, location=location, + api_version=api_version, template_url=self.get_by_name.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -163,7 +177,7 @@ async def get_by_name( return deserialized - get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + get_by_name.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}"} # type: ignore async def _purge_initial( @@ -178,17 +192,24 @@ async def _purge_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_purge_request_initial( service_name=service_name, subscription_id=self._config.subscription_id, location=location, + api_version=api_version, template_url=self._purge_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -204,7 +225,7 @@ async def _purge_initial( return deserialized - _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + _purge_initial.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}"} # type: ignore @distributed_trace_async @@ -231,10 +252,11 @@ async def begin_purge( :return: An instance of AsyncLROPoller that returns either DeletedServiceContract or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.DeletedServiceContract] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.DeletedServiceContract] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServiceContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -245,6 +267,7 @@ async def begin_purge( raw_result = await self._purge_initial( service_name=service_name, location=location, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -268,7 +291,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + begin_purge.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py index 9e620c5eb715..ecc7b6384661 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_diagnostic_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class DiagnosticOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,19 +63,22 @@ def list_by_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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DiagnosticCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.DiagnosticCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.DiagnosticCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -89,6 +91,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -103,6 +106,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -123,7 +127,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -137,7 +145,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -167,18 +175,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -194,7 +209,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async @@ -216,7 +231,7 @@ async def get( :type diagnostic_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -225,18 +240,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -254,7 +276,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async @@ -277,13 +299,13 @@ async def create_or_update( service instance. :type diagnostic_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -292,6 +314,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -301,6 +324,7 @@ async def create_or_update( service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -309,7 +333,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -333,7 +361,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async @@ -359,10 +387,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Diagnostic Update parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -371,6 +399,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -380,6 +409,7 @@ async def update( service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -388,7 +418,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -406,11 +440,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -441,19 +475,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -464,5 +505,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py index 88ef6c0e8bd2..df8ad9d633be 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_email_template_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class EmailTemplateOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -64,19 +63,22 @@ def list_by_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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EmailTemplateCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.EmailTemplateCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.EmailTemplateCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -89,6 +91,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -103,6 +106,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -123,7 +127,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -137,7 +145,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -154,7 +162,7 @@ async def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -166,18 +174,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -193,7 +208,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace_async @@ -211,10 +226,10 @@ async def get( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :keyword callable cls: A custom type or function that will be passed the direct response :return: EmailTemplateContract, or the result of cls(response) - :rtype: ~api_management_client.models.EmailTemplateContract + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateContract"] @@ -223,18 +238,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -252,7 +274,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace_async @@ -272,15 +294,15 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :param parameters: Email Template update parameters. - :type parameters: ~api_management_client.models.EmailTemplateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EmailTemplateContract, or the result of cls(response) - :rtype: ~api_management_client.models.EmailTemplateContract + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateContract"] @@ -289,6 +311,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'EmailTemplateUpdateParameters') @@ -298,6 +321,7 @@ async def create_or_update( service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -306,7 +330,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -325,7 +353,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace_async @@ -345,15 +373,15 @@ async def update( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :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: ~api_management_client.models.EmailTemplateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: EmailTemplateContract, or the result of cls(response) - :rtype: ~api_management_client.models.EmailTemplateContract + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateContract"] @@ -362,6 +390,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'EmailTemplateUpdateParameters') @@ -371,6 +400,7 @@ async def update( service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -379,7 +409,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -397,11 +431,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -416,7 +450,7 @@ async def delete( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :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 @@ -431,19 +465,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -454,5 +495,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py index 8c2df8e97d6f..8e68d4141bd7 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_api_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class GatewayApiOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,17 +67,20 @@ def list_by_service( :type gateway_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -92,6 +94,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -107,6 +110,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -127,7 +131,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,7 +149,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -174,6 +182,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -181,12 +191,17 @@ async def get_entity_tag( gateway_id=gateway_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -202,7 +217,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}"} # type: ignore @distributed_trace_async @@ -226,11 +241,11 @@ async def create_or_update( :type gateway_id: str :param api_id: API identifier. Must be unique in the current API Management service instance. :type api_id: str - :param parameters: - :type parameters: ~api_management_client.models.AssociationContract + :param parameters: Default value is None. + :type parameters: ~azure.mgmt.apimanagement.models.AssociationContract :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -239,6 +254,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if parameters is not None: @@ -252,6 +268,7 @@ async def create_or_update( gateway_id=gateway_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], @@ -259,7 +276,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -278,11 +299,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -312,6 +333,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -319,12 +342,17 @@ async def delete( gateway_id=gateway_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -335,5 +363,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py index ca28a4ce94ea..085703c2e83b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_certificate_authority_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class GatewayCertificateAuthorityOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,19 +67,21 @@ def list_by_service( :type gateway_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | - filter | eq, ne | |
. + filter | eq, ne | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCertificateAuthorityCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.GatewayCertificateAuthorityCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -94,6 +95,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -109,6 +111,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -129,7 +132,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -143,7 +150,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -177,6 +184,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -184,12 +193,17 @@ async def get_entity_tag( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -205,7 +219,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore @distributed_trace_async @@ -231,7 +245,7 @@ async def get( :type certificate_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCertificateAuthorityContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayCertificateAuthorityContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] @@ -240,6 +254,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -247,12 +263,17 @@ async def get( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -270,7 +291,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore @distributed_trace_async @@ -297,13 +318,13 @@ async def create_or_update( Management service instance. :type certificate_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayCertificateAuthorityContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCertificateAuthorityContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayCertificateAuthorityContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] @@ -312,6 +333,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayCertificateAuthorityContract') @@ -322,6 +344,7 @@ async def create_or_update( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -330,7 +353,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -354,11 +381,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -393,6 +420,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -400,13 +429,18 @@ async def delete( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -417,5 +451,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py index 377299dba9ce..c6389d5cafe0 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_hostname_configuration_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class GatewayHostnameConfigurationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -69,19 +68,22 @@ def list_by_service( :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 |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayHostnameConfigurationCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.GatewayHostnameConfigurationCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayHostnameConfigurationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -95,6 +97,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -110,6 +113,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -130,7 +134,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -144,7 +152,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -179,6 +187,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -186,12 +196,17 @@ async def get_entity_tag( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -207,7 +222,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore @distributed_trace_async @@ -233,7 +248,7 @@ async def get( :type hc_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayHostnameConfigurationContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayHostnameConfigurationContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayHostnameConfigurationContract"] @@ -242,6 +257,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -249,12 +266,17 @@ async def get( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -272,7 +294,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore @distributed_trace_async @@ -299,13 +321,13 @@ async def create_or_update( Gateway entity. :type hc_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayHostnameConfigurationContract + :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayHostnameConfigurationContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayHostnameConfigurationContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayHostnameConfigurationContract"] @@ -314,6 +336,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayHostnameConfigurationContract') @@ -324,6 +347,7 @@ async def create_or_update( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -332,7 +356,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -356,11 +384,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -395,6 +423,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -402,13 +432,18 @@ async def delete( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -419,5 +454,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py index 9532624637ec..50a50fd0c148 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_gateway_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class GatewayOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,18 +66,20 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.GatewayCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GatewayCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -91,6 +92,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -105,6 +107,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -125,7 +128,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -169,18 +176,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -196,7 +210,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace_async @@ -218,7 +232,7 @@ async def get( :type gateway_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayContract"] @@ -227,18 +241,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -256,7 +277,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace_async @@ -279,13 +300,13 @@ async def create_or_update( service instance. Must not have value 'managed'. :type gateway_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayContract"] @@ -294,6 +315,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayContract') @@ -303,6 +325,7 @@ async def create_or_update( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -311,7 +334,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -335,7 +362,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace_async @@ -361,10 +388,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: - :type parameters: ~api_management_client.models.GatewayContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayContract :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayContract"] @@ -373,6 +400,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayContract') @@ -382,6 +410,7 @@ async def update( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -390,7 +419,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -408,11 +441,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -443,19 +476,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -466,7 +506,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace_async @@ -488,7 +528,7 @@ async def list_keys( :type gateway_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayKeysContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayKeysContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayKeysContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayKeysContract"] @@ -497,18 +537,25 @@ async def list_keys( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_keys_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_keys.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -526,11 +573,11 @@ async def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys"} # type: ignore @distributed_trace_async - async def regenerate_key( + async def regenerate_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -548,7 +595,7 @@ async def regenerate_key( service instance. Must not have value 'managed'. :type gateway_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayKeyRegenerationRequestContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayKeyRegenerationRequestContract :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -560,6 +607,7 @@ async def regenerate_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayKeyRegenerationRequestContract') @@ -569,6 +617,7 @@ async def regenerate_key( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.regenerate_key.metadata['url'], @@ -576,7 +625,11 @@ async def regenerate_key( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -587,7 +640,7 @@ async def regenerate_key( if cls: return cls(pipeline_response, None, {}) - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey'} # type: ignore + regenerate_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey"} # type: ignore @distributed_trace_async @@ -609,10 +662,10 @@ async def generate_token( service instance. Must not have value 'managed'. :type gateway_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayTokenRequestContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayTokenRequestContract :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayTokenContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayTokenContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayTokenContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayTokenContract"] @@ -621,6 +674,7 @@ async def generate_token( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayTokenRequestContract') @@ -630,6 +684,7 @@ async def generate_token( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.generate_token.metadata['url'], @@ -637,7 +692,11 @@ async def generate_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -652,5 +711,5 @@ async def generate_token( return deserialized - generate_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken'} # type: ignore + generate_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_global_schema_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_global_schema_operations.py index 936b21136c7a..3f5f82354f5c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_global_schema_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_global_schema_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class GlobalSchemaOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,19 +65,22 @@ def list_by_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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GlobalSchemaCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.GlobalSchemaCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GlobalSchemaCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GlobalSchemaCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -91,6 +93,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -105,6 +108,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -125,7 +129,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,7 +147,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -169,18 +177,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -196,7 +211,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore @distributed_trace_async @@ -218,7 +233,7 @@ async def get( :type schema_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GlobalSchemaContract, or the result of cls(response) - :rtype: ~api_management_client.models.GlobalSchemaContract + :rtype: ~azure.mgmt.apimanagement.models.GlobalSchemaContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GlobalSchemaContract"] @@ -227,18 +242,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -256,7 +278,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore async def _create_or_update_initial( @@ -274,6 +296,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GlobalSchemaContract') @@ -283,6 +306,7 @@ async def _create_or_update_initial( service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -291,7 +315,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -315,7 +343,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore @distributed_trace_async @@ -338,9 +366,9 @@ async def begin_create_or_update( instance. :type schema_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.GlobalSchemaContract + :type parameters: ~azure.mgmt.apimanagement.models.GlobalSchemaContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -352,11 +380,13 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either GlobalSchemaContract or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~api_management_client.models.GlobalSchemaContract] + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.GlobalSchemaContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.GlobalSchemaContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -370,6 +400,7 @@ async def begin_create_or_update( schema_id=schema_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -397,13 +428,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -434,19 +464,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -457,5 +494,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py index 6e5205129cf0..18e3585c632c 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class GroupOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,17 +66,20 @@ def list_by_service( filter | ge, le, eq, ne, gt, lt | substringof, contains, 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 |
| externalId | filter | eq | |
. + endswith |
| externalId | filter | eq | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GroupCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.GroupCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GroupCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -90,6 +92,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -104,6 +107,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -124,7 +128,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -138,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -168,18 +176,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -195,7 +210,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace_async @@ -217,7 +232,7 @@ async def get( :type group_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -226,18 +241,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -255,7 +277,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace_async @@ -278,13 +300,13 @@ async def create_or_update( instance. :type group_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.GroupCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.GroupCreateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -293,6 +315,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GroupCreateParameters') @@ -302,6 +325,7 @@ async def create_or_update( service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -310,7 +334,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -334,7 +362,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace_async @@ -360,10 +388,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.GroupUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.GroupUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -372,6 +400,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GroupUpdateParameters') @@ -381,6 +410,7 @@ async def update( service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -389,7 +419,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -407,11 +441,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -442,19 +476,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -465,5 +506,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py index b56c43212553..dd4ff4b5b0e7 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_group_user_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class GroupUserOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -73,17 +72,20 @@ def list( 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 |
. + le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either UserCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.UserCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.UserCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -97,6 +99,7 @@ def prepare_request(next_link=None): service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -112,6 +115,7 @@ def prepare_request(next_link=None): service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -132,7 +136,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -146,7 +154,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users"} # type: ignore @distributed_trace_async async def check_entity_exists( @@ -179,6 +187,8 @@ async def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -186,12 +196,17 @@ async def check_entity_exists( group_id=group_id, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -203,7 +218,7 @@ async def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}"} # type: ignore @distributed_trace_async @@ -228,7 +243,7 @@ async def create( :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -237,6 +252,8 @@ async def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_request( resource_group_name=resource_group_name, @@ -244,12 +261,17 @@ async def create( group_id=group_id, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -268,11 +290,11 @@ async def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -302,6 +324,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -309,12 +333,17 @@ async def delete( group_id=group_id, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -325,5 +354,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py index de7c1908612d..cb155e3549a2 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_identity_provider_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class IdentityProviderOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,9 +62,11 @@ def list_by_service( :return: An iterator like instance of either IdentityProviderList or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.IdentityProviderList] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.IdentityProviderList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -78,6 +79,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -89,6 +91,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -106,7 +109,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -120,7 +127,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -137,7 +144,7 @@ async def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -149,18 +156,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -176,7 +190,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace_async @@ -195,10 +209,10 @@ async def get( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword callable cls: A custom type or function that will be passed the direct response :return: IdentityProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.IdentityProviderContract + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderContract"] @@ -207,18 +221,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -236,7 +257,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace_async @@ -256,15 +277,15 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IdentityProviderCreateContract + :type parameters: ~azure.mgmt.apimanagement.models.IdentityProviderCreateContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IdentityProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.IdentityProviderContract + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderContract"] @@ -273,6 +294,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IdentityProviderCreateContract') @@ -282,6 +304,7 @@ async def create_or_update( service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -290,7 +313,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -314,7 +341,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace_async @@ -334,15 +361,15 @@ async def update( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :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: ~api_management_client.models.IdentityProviderUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.IdentityProviderUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: IdentityProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.IdentityProviderContract + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderContract"] @@ -351,6 +378,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IdentityProviderUpdateParameters') @@ -360,6 +388,7 @@ async def update( service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -368,7 +397,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -386,11 +419,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -405,7 +438,7 @@ async def delete( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :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 @@ -420,19 +453,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -443,7 +483,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace_async @@ -461,10 +501,10 @@ async def list_secrets( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword callable cls: A custom type or function that will be passed the direct response :return: ClientSecretContract, or the result of cls(response) - :rtype: ~api_management_client.models.ClientSecretContract + :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientSecretContract"] @@ -473,18 +513,25 @@ async def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -502,5 +549,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py index c98e6d620436..2bd5fea0d8e0 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_issue_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class IssueOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -69,17 +68,20 @@ def list_by_service( 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 | |
. + endswith |
| state | filter | eq | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.IssueCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.IssueCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -92,6 +94,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -106,6 +109,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -126,7 +130,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -140,7 +148,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues"} # type: ignore @distributed_trace_async async def get( @@ -161,7 +169,7 @@ async def get( :type issue_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -170,18 +178,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -199,5 +214,5 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py index 3de82e8a7bc0..cc676cc20c9d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_logger_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class LoggerOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -67,17 +66,20 @@ def list_by_service( 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 |
. + substringof, contains, startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LoggerCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.LoggerCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.LoggerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -90,6 +92,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -104,6 +107,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -124,7 +128,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -138,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -167,18 +175,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -194,7 +209,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace_async @@ -215,7 +230,7 @@ async def get( :type logger_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LoggerContract, or the result of cls(response) - :rtype: ~api_management_client.models.LoggerContract + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerContract"] @@ -224,18 +239,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -253,7 +275,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace_async @@ -275,13 +297,13 @@ async def create_or_update( :param logger_id: Logger identifier. Must be unique in the API Management service instance. :type logger_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.LoggerContract + :type parameters: ~azure.mgmt.apimanagement.models.LoggerContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LoggerContract, or the result of cls(response) - :rtype: ~api_management_client.models.LoggerContract + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerContract"] @@ -290,6 +312,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LoggerContract') @@ -299,6 +322,7 @@ async def create_or_update( service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -307,7 +331,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -331,7 +359,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace_async @@ -356,10 +384,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.LoggerUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.LoggerUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: LoggerContract, or the result of cls(response) - :rtype: ~api_management_client.models.LoggerContract + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerContract"] @@ -368,6 +396,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LoggerUpdateContract') @@ -377,6 +406,7 @@ async def update( service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -385,7 +415,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -403,11 +437,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -437,19 +471,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -460,5 +501,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py index 32e37b7e7354..0c580fa627fe 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_named_value_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class NamedValueOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -69,22 +68,24 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :param is_key_vault_refresh_failed: When set to true, the response contains only named value - entities which failed refresh. + entities which failed refresh. Default value is None. :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NamedValueCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.NamedValueCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.NamedValueCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -97,6 +98,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -112,6 +114,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -133,7 +136,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -147,7 +154,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -176,18 +183,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -203,7 +217,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace_async @@ -224,7 +238,7 @@ async def get( :type named_value_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NamedValueContract, or the result of cls(response) - :rtype: ~api_management_client.models.NamedValueContract + :rtype: ~azure.mgmt.apimanagement.models.NamedValueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] @@ -233,18 +247,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -262,7 +283,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore async def _create_or_update_initial( @@ -280,6 +301,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'NamedValueCreateContract') @@ -289,6 +311,7 @@ async def _create_or_update_initial( service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -297,7 +320,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -321,7 +348,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace_async @@ -343,9 +370,9 @@ async def begin_create_or_update( :param named_value_id: Identifier of the NamedValue. :type named_value_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.NamedValueCreateContract + :type parameters: ~azure.mgmt.apimanagement.models.NamedValueCreateContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -357,11 +384,12 @@ async def begin_create_or_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either NamedValueContract or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~api_management_client.models.NamedValueContract] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -375,6 +403,7 @@ async def begin_create_or_update( named_value_id=named_value_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -402,10 +431,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore async def _update_initial( self, @@ -422,6 +450,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'NamedValueUpdateParameters') @@ -431,6 +460,7 @@ async def _update_initial( service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -439,7 +469,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -458,7 +492,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace_async @@ -483,7 +517,7 @@ async def begin_update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.NamedValueUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.NamedValueUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -494,11 +528,12 @@ async def begin_update( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either NamedValueContract or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~api_management_client.models.NamedValueContract] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -512,6 +547,7 @@ async def begin_update( named_value_id=named_value_id, if_match=if_match, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -539,13 +575,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -575,19 +610,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -598,7 +640,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace_async @@ -619,7 +661,7 @@ async def list_value( :type named_value_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NamedValueSecretContract, or the result of cls(response) - :rtype: ~api_management_client.models.NamedValueSecretContract + :rtype: ~azure.mgmt.apimanagement.models.NamedValueSecretContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueSecretContract"] @@ -628,18 +670,25 @@ async def list_value( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_value_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_value.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -657,7 +706,7 @@ async def list_value( return deserialized - list_value.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue'} # type: ignore + list_value.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue"} # type: ignore async def _refresh_secret_initial( @@ -673,18 +722,25 @@ async def _refresh_secret_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_refresh_secret_request_initial( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._refresh_secret_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -703,7 +759,7 @@ async def _refresh_secret_initial( return deserialized - _refresh_secret_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore + _refresh_secret_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret"} # type: ignore @distributed_trace_async @@ -732,10 +788,11 @@ async def begin_refresh_secret( Retry-After header is present. :return: An instance of AsyncLROPoller that returns either NamedValueContract or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~api_management_client.models.NamedValueContract] + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -747,6 +804,7 @@ async def begin_refresh_secret( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -773,7 +831,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore + begin_refresh_secret.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py index 37ccbb58477f..25c9e41cda45 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_network_status_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, List, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class NetworkStatusOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,7 +60,7 @@ async def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: list of NetworkStatusContractByLocation, or the result of cls(response) - :rtype: list[~api_management_client.models.NetworkStatusContractByLocation] + :rtype: list[~azure.mgmt.apimanagement.models.NetworkStatusContractByLocation] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkStatusContractByLocation"]] @@ -70,17 +69,24 @@ async def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -95,7 +101,7 @@ async def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus"} # type: ignore @distributed_trace_async @@ -119,7 +125,7 @@ async def list_by_location( :type location_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NetworkStatusContract, or the result of cls(response) - :rtype: ~api_management_client.models.NetworkStatusContract + :rtype: ~azure.mgmt.apimanagement.models.NetworkStatusContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkStatusContract"] @@ -128,18 +134,25 @@ async def list_by_location( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_location_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, location_name=location_name, + api_version=api_version, template_url=self.list_by_location.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -154,5 +167,5 @@ async def list_by_location( return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus'} # type: ignore + list_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py index 75eea4d6b3d6..3c2934dbdcf8 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class NotificationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,17 +60,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 top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NotificationCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.NotificationCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.NotificationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -84,6 +85,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=self.list_by_service.metadata['url'], @@ -97,6 +99,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=next_link, @@ -116,7 +119,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -130,7 +137,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications"} # type: ignore @distributed_trace_async async def get( @@ -147,10 +154,10 @@ async def get( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :keyword callable cls: A custom type or function that will be passed the direct response :return: NotificationContract, or the result of cls(response) - :rtype: ~api_management_client.models.NotificationContract + :rtype: ~azure.mgmt.apimanagement.models.NotificationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationContract"] @@ -159,18 +166,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -185,7 +199,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}"} # type: ignore @distributed_trace_async @@ -204,13 +218,13 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NotificationContract, or the result of cls(response) - :rtype: ~api_management_client.models.NotificationContract + :rtype: ~azure.mgmt.apimanagement.models.NotificationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationContract"] @@ -219,19 +233,26 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -246,5 +267,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py index f0cf5318d950..c6ee6b7b54e9 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_email_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class NotificationRecipientEmailOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,10 +58,10 @@ async def list_by_notification( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientEmailCollection, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientEmailCollection + :rtype: ~azure.mgmt.apimanagement.models.RecipientEmailCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientEmailCollection"] @@ -71,18 +70,25 @@ async def list_by_notification( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_notification_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_notification.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -97,7 +103,7 @@ async def list_by_notification( return deserialized - list_by_notification.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails'} # type: ignore + list_by_notification.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails"} # type: ignore @distributed_trace_async @@ -116,7 +122,7 @@ async def check_entity_exists( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param email: Email identifier. :type email: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,6 +136,8 @@ async def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -137,12 +145,17 @@ async def check_entity_exists( notification_name=notification_name, email=email, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -154,7 +167,7 @@ async def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}"} # type: ignore @distributed_trace_async @@ -173,12 +186,12 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param email: Email identifier. :type email: str :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientEmailContract, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientEmailContract + :rtype: ~azure.mgmt.apimanagement.models.RecipientEmailContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientEmailContract"] @@ -187,6 +200,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -194,12 +209,17 @@ async def create_or_update( notification_name=notification_name, email=email, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -218,11 +238,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -237,7 +257,7 @@ async def delete( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param email: Email identifier. :type email: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -251,6 +271,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -258,12 +280,17 @@ async def delete( notification_name=notification_name, email=email, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -274,5 +301,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py index f62941b881f8..3f9b80d1fb05 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_notification_recipient_user_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class NotificationRecipientUserOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,10 +58,10 @@ async def list_by_notification( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientUserCollection, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientUserCollection + :rtype: ~azure.mgmt.apimanagement.models.RecipientUserCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientUserCollection"] @@ -71,18 +70,25 @@ async def list_by_notification( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_notification_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_notification.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -97,7 +103,7 @@ async def list_by_notification( return deserialized - list_by_notification.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers'} # type: ignore + list_by_notification.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers"} # type: ignore @distributed_trace_async @@ -116,7 +122,7 @@ async def check_entity_exists( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -130,6 +136,8 @@ async def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -137,12 +145,17 @@ async def check_entity_exists( notification_name=notification_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -154,7 +167,7 @@ async def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}"} # type: ignore @distributed_trace_async @@ -173,12 +186,12 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientUserContract, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientUserContract + :rtype: ~azure.mgmt.apimanagement.models.RecipientUserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientUserContract"] @@ -187,6 +200,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -194,12 +209,17 @@ async def create_or_update( notification_name=notification_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -218,11 +238,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -237,7 +257,7 @@ async def delete( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -251,6 +271,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -258,12 +280,17 @@ async def delete( notification_name=notification_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -274,5 +301,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py index 9358f344731e..a9f14de426b2 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_open_id_connect_provider_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class OpenIdConnectProviderOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,19 +65,21 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OpenIdConnectProviderCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.OpenIdConnectProviderCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.OpenIdConnectProviderCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenIdConnectProviderCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -91,6 +92,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -105,6 +107,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -125,7 +128,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -168,18 +175,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -195,7 +209,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace_async @@ -216,7 +230,7 @@ async def get( :type opid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OpenidConnectProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.OpenidConnectProviderContract + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenidConnectProviderContract"] @@ -225,18 +239,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -254,7 +275,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace_async @@ -276,13 +297,13 @@ async def create_or_update( :param opid: Identifier of the OpenID Connect Provider. :type opid: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.OpenidConnectProviderContract + :type parameters: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OpenidConnectProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.OpenidConnectProviderContract + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenidConnectProviderContract"] @@ -291,6 +312,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OpenidConnectProviderContract') @@ -300,6 +322,7 @@ async def create_or_update( service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -308,7 +331,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -332,7 +359,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace_async @@ -357,10 +384,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.OpenidConnectProviderUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.OpenidConnectProviderUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: OpenidConnectProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.OpenidConnectProviderContract + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenidConnectProviderContract"] @@ -369,6 +396,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OpenidConnectProviderUpdateContract') @@ -378,6 +406,7 @@ async def update( service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -386,7 +415,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -404,11 +437,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -438,19 +471,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -461,7 +501,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace_async @@ -482,7 +522,7 @@ async def list_secrets( :type opid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ClientSecretContract, or the result of cls(response) - :rtype: ~api_management_client.models.ClientSecretContract + :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientSecretContract"] @@ -491,18 +531,25 @@ async def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -520,5 +567,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py index b37cd029b939..daa0db67ae32 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_operation_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class OperationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -75,21 +73,23 @@ def list_by_tags( |
| 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 |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param include_not_tagged_operations: Include not tagged Operations. + :param include_not_tagged_operations: Include not tagged Operations. Default value is None. :type include_not_tagged_operations: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagResourceCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -103,6 +103,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -119,6 +120,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -140,7 +142,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -154,4 +160,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags'} # type: ignore + list_by_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_outbound_network_dependencies_endpoints_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_outbound_network_dependencies_endpoints_operations.py index 38b180191350..ea98075fe314 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_outbound_network_dependencies_endpoints_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_outbound_network_dependencies_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class OutboundNetworkDependenciesEndpointsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +58,7 @@ async def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OutboundEnvironmentEndpointList, or the result of cls(response) - :rtype: ~api_management_client.models.OutboundEnvironmentEndpointList + :rtype: ~azure.mgmt.apimanagement.models.OutboundEnvironmentEndpointList :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointList"] @@ -68,17 +67,24 @@ async def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -93,5 +99,5 @@ async def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/outboundNetworkDependenciesEndpoints"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py index 39b0565a0a18..473838bbbfb9 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_description_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class PolicyDescriptionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -58,11 +57,11 @@ async def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param scope: Policy scope. - :type scope: str or ~api_management_client.models.PolicyScopeContract + :param scope: Policy scope. Default value is None. + :type scope: str or ~azure.mgmt.apimanagement.models.PolicyScopeContract :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyDescriptionCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyDescriptionCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyDescriptionCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyDescriptionCollection"] @@ -71,18 +70,25 @@ async def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, scope=scope, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -97,5 +103,5 @@ async def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py index 730db8ebd442..aeffc7291018 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_policy_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class PolicyOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +58,7 @@ async def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -68,17 +67,24 @@ async def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -93,7 +99,7 @@ async def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies"} # type: ignore @distributed_trace_async @@ -112,7 +118,7 @@ async def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -124,18 +130,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -151,7 +164,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -170,12 +183,12 @@ async def get( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -184,19 +197,26 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -214,7 +234,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -234,15 +254,15 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -251,6 +271,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -260,6 +281,7 @@ async def create_or_update( service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -268,7 +290,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -292,11 +318,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -311,7 +337,7 @@ async def delete( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -326,19 +352,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -349,5 +382,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py index fbdf3b40ab1f..b69c78a37754 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_revision_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class PortalRevisionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -75,19 +74,21 @@ def list_by_service( |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 | |. + |isCurrent | eq, ne | |. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PortalRevisionCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.PortalRevisionCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.PortalRevisionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -100,6 +101,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -114,6 +116,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -134,7 +137,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -148,7 +155,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -178,18 +185,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -205,7 +219,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore @distributed_trace_async @@ -227,7 +241,7 @@ async def get( :type portal_revision_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalRevisionContract, or the result of cls(response) - :rtype: ~api_management_client.models.PortalRevisionContract + :rtype: ~azure.mgmt.apimanagement.models.PortalRevisionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionContract"] @@ -236,18 +250,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -265,7 +286,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore async def _create_or_update_initial( @@ -282,6 +303,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalRevisionContract') @@ -291,6 +313,7 @@ async def _create_or_update_initial( service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -298,7 +321,11 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201, 202]: @@ -317,7 +344,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore @distributed_trace_async @@ -340,7 +367,7 @@ async def begin_create_or_update( Management service instance. :type portal_revision_id: str :param parameters: - :type parameters: ~api_management_client.models.PortalRevisionContract + :type parameters: ~azure.mgmt.apimanagement.models.PortalRevisionContract :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -352,11 +379,12 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either PortalRevisionContract or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.PortalRevisionContract] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.PortalRevisionContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -369,6 +397,7 @@ async def begin_create_or_update( service_name=service_name, portal_revision_id=portal_revision_id, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -396,10 +425,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore async def _update_initial( self, @@ -416,6 +444,7 @@ async def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalRevisionContract') @@ -425,6 +454,7 @@ async def _update_initial( service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -433,7 +463,11 @@ async def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -452,7 +486,7 @@ async def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore @distributed_trace_async @@ -478,7 +512,7 @@ async def begin_update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: - :type parameters: ~api_management_client.models.PortalRevisionContract + :type parameters: ~azure.mgmt.apimanagement.models.PortalRevisionContract :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -490,11 +524,12 @@ async def begin_update( :return: An instance of AsyncLROPoller that returns either PortalRevisionContract or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.PortalRevisionContract] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.PortalRevisionContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -508,6 +543,7 @@ async def begin_update( portal_revision_id=portal_revision_id, if_match=if_match, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -535,7 +571,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py index cb531842816a..0129cb4e6244 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_portal_settings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class PortalSettingsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -59,7 +58,7 @@ async def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSettingsCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSettingsCollection + :rtype: ~azure.mgmt.apimanagement.models.PortalSettingsCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSettingsCollection"] @@ -68,17 +67,24 @@ async def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -93,5 +99,5 @@ async def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_private_endpoint_connection_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_private_endpoint_connection_operations.py index 85164a1dc335..b1a7605713ee 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_private_endpoint_connection_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_private_endpoint_connection_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -33,7 +32,7 @@ class PrivateEndpointConnectionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -65,9 +64,11 @@ def list_by_service( :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.PrivateEndpointConnectionListResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -80,6 +81,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -91,6 +93,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -108,7 +111,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -122,7 +129,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections"} # type: ignore @distributed_trace_async async def get_by_name( @@ -142,7 +149,7 @@ async def get_by_name( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~api_management_client.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.apimanagement.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] @@ -151,18 +158,25 @@ async def get_by_name( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_name_request( resource_group_name=resource_group_name, service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_name.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -177,7 +191,7 @@ async def get_by_name( return deserialized - get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get_by_name.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore async def _create_or_update_initial( @@ -194,6 +208,7 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(private_endpoint_connection_request, 'PrivateEndpointConnectionRequest') @@ -203,6 +218,7 @@ async def _create_or_update_initial( service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -210,10 +226,14 @@ async def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) @@ -226,7 +246,7 @@ async def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async @@ -248,7 +268,7 @@ async def begin_create_or_update( :type private_endpoint_connection_name: str :param private_endpoint_connection_request: :type private_endpoint_connection_request: - ~api_management_client.models.PrivateEndpointConnectionRequest + ~azure.mgmt.apimanagement.models.PrivateEndpointConnectionRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -260,11 +280,12 @@ async def begin_create_or_update( :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.PrivateEndpointConnection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.PrivateEndpointConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -277,6 +298,7 @@ async def begin_create_or_update( service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, private_endpoint_connection_request=private_endpoint_connection_request, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -301,12 +323,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - async def _delete_initial( + async def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -319,18 +340,25 @@ async def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -340,11 +368,11 @@ async def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async - async def begin_delete( + async def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -371,7 +399,8 @@ async def begin_delete( :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -383,6 +412,7 @@ async def begin_delete( resource_group_name=resource_group_name, service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -403,10 +433,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace_async async def list_private_link_resources( @@ -415,7 +444,7 @@ async def list_private_link_resources( service_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": - """Description for Gets the private link resources. + """Gets the private link resources. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -423,7 +452,7 @@ async def list_private_link_resources( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResourceListResult, or the result of cls(response) - :rtype: ~api_management_client.models.PrivateLinkResourceListResult + :rtype: ~azure.mgmt.apimanagement.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] @@ -432,17 +461,24 @@ async def list_private_link_resources( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_private_link_resources_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, service_name=service_name, + api_version=api_version, template_url=self.list_private_link_resources.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -457,7 +493,7 @@ async def list_private_link_resources( return deserialized - list_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources'} # type: ignore + list_private_link_resources.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources"} # type: ignore @distributed_trace_async @@ -468,7 +504,7 @@ async def get_private_link_resource( private_link_sub_resource_name: str, **kwargs: Any ) -> "_models.PrivateLinkResource": - """Description for Gets the private link resources. + """Gets the private link resources. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -478,7 +514,7 @@ async def get_private_link_resource( :type private_link_sub_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~api_management_client.models.PrivateLinkResource + :rtype: ~azure.mgmt.apimanagement.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] @@ -487,18 +523,25 @@ async def get_private_link_resource( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_private_link_resource_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, service_name=service_name, private_link_sub_resource_name=private_link_sub_resource_name, + api_version=api_version, template_url=self.get_private_link_resource.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -513,5 +556,5 @@ async def get_private_link_resource( return deserialized - get_private_link_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources/{privateLinkSubResourceName}'} # type: ignore + get_private_link_resource.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources/{privateLinkSubResourceName}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py index ca2e8352d498..1216ec3888d8 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_api_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ProductApiOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -73,17 +72,19 @@ def list_by_product( |
| 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 |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ApiCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ApiCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -97,6 +98,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -112,6 +114,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -132,7 +135,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -146,7 +153,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis"} # type: ignore @distributed_trace_async async def check_entity_exists( @@ -180,6 +187,8 @@ async def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -187,12 +196,17 @@ async def check_entity_exists( product_id=product_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -204,7 +218,7 @@ async def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}"} # type: ignore @distributed_trace_async @@ -230,7 +244,7 @@ async def create_or_update( :type api_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -239,6 +253,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -246,12 +262,17 @@ async def create_or_update( product_id=product_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -270,11 +291,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -305,6 +326,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -312,12 +335,17 @@ async def delete( product_id=product_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -328,5 +356,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py index 94c57e93cf86..f182cc358bed 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_group_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ProductGroupOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -69,17 +68,20 @@ def list_by_product( :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | |
| displayName | filter | eq, ne | |
| - description | filter | eq, ne | |
. + description | filter | eq, ne | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GroupCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.GroupCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GroupCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -93,6 +95,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -108,6 +111,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -128,7 +132,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -142,7 +150,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups"} # type: ignore @distributed_trace_async async def check_entity_exists( @@ -176,6 +184,8 @@ async def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -183,12 +193,17 @@ async def check_entity_exists( product_id=product_id, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -200,7 +215,7 @@ async def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}"} # type: ignore @distributed_trace_async @@ -226,7 +241,7 @@ async def create_or_update( :type group_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -235,6 +250,8 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -242,12 +259,17 @@ async def create_or_update( product_id=product_id, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -266,11 +288,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -301,6 +323,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -308,12 +332,17 @@ async def delete( product_id=product_id, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -324,5 +353,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py index b674f7c7d02e..7d0f128bfdb3 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class ProductOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -70,23 +69,26 @@ def list_by_service( 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 | | |
. + endswith |
| state | filter | eq | |
| groups | expand | | |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :param expand_groups: When set to true, the response contains an array of groups that have visibility to the product. The default is false. :type expand_groups: bool - :param tags: Products which are part of a specific tag. + :param tags: Products which are part of a specific tag. Default value is None. :type tags: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ProductCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ProductCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -99,6 +101,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -115,6 +118,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -137,7 +141,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -151,7 +159,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -181,18 +189,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -208,7 +223,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace_async @@ -230,7 +245,7 @@ async def get( :type product_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ProductContract, or the result of cls(response) - :rtype: ~api_management_client.models.ProductContract + :rtype: ~azure.mgmt.apimanagement.models.ProductContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductContract"] @@ -239,18 +254,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -268,7 +290,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace_async @@ -291,13 +313,13 @@ async def create_or_update( instance. :type product_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.ProductContract + :type parameters: ~azure.mgmt.apimanagement.models.ProductContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ProductContract, or the result of cls(response) - :rtype: ~api_management_client.models.ProductContract + :rtype: ~azure.mgmt.apimanagement.models.ProductContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductContract"] @@ -306,6 +328,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ProductContract') @@ -315,6 +338,7 @@ async def create_or_update( service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -323,7 +347,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -347,7 +375,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace_async @@ -373,10 +401,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.ProductUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.ProductUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ProductContract, or the result of cls(response) - :rtype: ~api_management_client.models.ProductContract + :rtype: ~azure.mgmt.apimanagement.models.ProductContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductContract"] @@ -385,6 +413,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ProductUpdateParameters') @@ -394,6 +423,7 @@ async def update( service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -402,7 +432,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -420,11 +454,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -446,6 +480,7 @@ async def delete( response of the GET request or it should be * for unconditional update. :type if_match: str :param delete_subscriptions: Delete existing subscriptions associated with the product or not. + Default value is None. :type delete_subscriptions: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -458,12 +493,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, delete_subscriptions=delete_subscriptions, template_url=self.delete.metadata['url'], @@ -471,7 +509,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -482,7 +524,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace @@ -509,20 +551,23 @@ def list_by_tags( |
| 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 |
. + Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param include_not_tagged_products: Include not tagged Products. + :param include_not_tagged_products: Include not tagged Products. Default value is None. :type include_not_tagged_products: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagResourceCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -535,6 +580,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -550,6 +596,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -571,7 +618,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -585,4 +636,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags'} # type: ignore + list_by_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py index 1929f57392e9..4b958ff5b96b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_policy_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class ProductPolicyOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -63,7 +62,7 @@ async def list_by_product( :type product_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -72,18 +71,25 @@ async def list_by_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_product_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -98,7 +104,7 @@ async def list_by_product( return deserialized - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies"} # type: ignore @distributed_trace_async @@ -120,7 +126,7 @@ async def get_entity_tag( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -132,6 +138,8 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -139,12 +147,17 @@ async def get_entity_tag( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -160,7 +173,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -183,12 +196,12 @@ async def get( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -197,6 +210,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -204,13 +219,18 @@ async def get( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -228,7 +248,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore @distributed_trace_async @@ -252,15 +272,15 @@ async def create_or_update( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -269,6 +289,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -279,6 +300,7 @@ async def create_or_update( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -287,7 +309,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -311,11 +337,11 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -334,7 +360,7 @@ async def delete( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -349,6 +375,8 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -356,13 +384,18 @@ async def delete( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -373,5 +406,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py index a258bb53ce26..ec35b6e92816 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_product_subscriptions_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class ProductSubscriptionsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -76,19 +74,21 @@ def list( 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 | | - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SubscriptionCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.SubscriptionCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.SubscriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -102,6 +102,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -117,6 +118,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -137,7 +139,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -151,4 +157,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py index 330c216fef8b..159c497c25a1 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_counter_keys_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class QuotaByCounterKeysOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,7 +65,7 @@ async def list_by_service( :type quota_counter_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterCollection, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterCollection + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterCollection"] @@ -75,18 +74,25 @@ async def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, quota_counter_key=quota_counter_key, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -101,7 +107,7 @@ async def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}"} # type: ignore @distributed_trace_async @@ -126,10 +132,10 @@ async def update( as counter-key="@("b"+"a")" then it will be accessible by "ba" key. :type quota_counter_key: str :param parameters: The value of the quota counter to be applied to all quota counter periods. - :type parameters: ~api_management_client.models.QuotaCounterValueUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.QuotaCounterValueUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterCollection, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterCollection + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterCollection"] @@ -138,6 +144,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') @@ -147,6 +154,7 @@ async def update( service_name=service_name, quota_counter_key=quota_counter_key, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.update.metadata['url'], @@ -154,7 +162,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -169,5 +181,5 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py index d3833e77f2a7..d9344f549752 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_quota_by_period_keys_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class QuotaByPeriodKeysOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -69,7 +68,7 @@ async def get( :type quota_period_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterContract, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterContract + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterContract"] @@ -78,6 +77,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -85,12 +86,17 @@ async def get( quota_counter_key=quota_counter_key, quota_period_key=quota_period_key, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -105,7 +111,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}"} # type: ignore @distributed_trace_async @@ -132,10 +138,10 @@ async def update( :param quota_period_key: Quota period key identifier. :type quota_period_key: str :param parameters: The value of the Quota counter to be applied on the specified period. - :type parameters: ~api_management_client.models.QuotaCounterValueUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.QuotaCounterValueUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterContract, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterContract + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterContract"] @@ -144,6 +150,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') @@ -154,6 +161,7 @@ async def update( quota_counter_key=quota_counter_key, quota_period_key=quota_period_key, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.update.metadata['url'], @@ -161,7 +169,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -176,5 +188,5 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py index 48c3f86af353..de053d859a65 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_region_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class RegionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -61,9 +59,12 @@ def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegionListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.RegionListResult] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.RegionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -76,6 +77,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -87,6 +89,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -104,7 +107,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -118,4 +125,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py index 385b86887fe2..62db48b68a7d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_reports_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +7,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -16,7 +15,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -32,7 +30,7 @@ class ReportsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,17 +64,20 @@ def list_by_api( :type service_name: str :param filter: The filter to apply on the operation. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ReportCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -89,6 +90,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -104,6 +106,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -125,7 +128,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -139,7 +146,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi"} # type: ignore @distributed_trace def list_by_user( @@ -172,17 +179,20 @@ def list_by_user(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ReportCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -195,6 +205,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -210,6 +221,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -231,7 +243,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -245,7 +261,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser'} # type: ignore + list_by_user.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser"} # type: ignore @distributed_trace def list_by_operation( @@ -278,17 +294,20 @@ def list_by_operation(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ReportCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -301,6 +320,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -316,6 +336,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -337,7 +358,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -351,7 +376,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation'} # type: ignore + list_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation"} # type: ignore @distributed_trace def list_by_product( @@ -383,17 +408,20 @@ def list_by_product(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ReportCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -406,6 +434,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -421,6 +450,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -442,7 +472,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -456,7 +490,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct"} # type: ignore @distributed_trace def list_by_geo( @@ -488,15 +522,18 @@ def list_by_geo( serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ReportCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -509,6 +546,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -523,6 +561,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -543,7 +582,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -557,7 +600,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_geo.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo'} # type: ignore + list_by_geo.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo"} # type: ignore @distributed_trace def list_by_subscription( @@ -589,17 +632,20 @@ def list_by_subscription(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ReportCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -612,6 +658,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -627,6 +674,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -648,7 +696,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -662,7 +714,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription"} # type: ignore @distributed_trace def list_by_time( @@ -700,17 +752,20 @@ def list_by_time( code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). :type interval: ~datetime.timedelta - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.ReportCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -723,6 +778,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, interval=interval, top=top, @@ -739,6 +795,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, interval=interval, top=top, @@ -761,7 +818,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -775,7 +836,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_time.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime'} # type: ignore + list_by_time.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime"} # type: ignore @distributed_trace def list_by_request( @@ -799,17 +860,19 @@ def list_by_request( |
| productId | filter | eq | |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter | eq | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RequestReportCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.RequestReportCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.RequestReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -822,6 +885,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -836,6 +900,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -856,7 +921,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -870,4 +939,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_request.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest'} # type: ignore + list_by_request.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py index 7a1093beb971..7cb9be393547 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_in_settings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class SignInSettingsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,17 +67,24 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -94,7 +100,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore @distributed_trace_async @@ -112,7 +118,7 @@ async def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSigninSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSigninSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSigninSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSigninSettings"] @@ -121,17 +127,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,11 +162,11 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore @distributed_trace_async - async def update( + async def update( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -171,7 +184,7 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update Sign-In settings. - :type parameters: ~api_management_client.models.PortalSigninSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSigninSettings :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -183,6 +196,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSigninSettings') @@ -191,6 +205,7 @@ async def update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -199,7 +214,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -210,7 +229,7 @@ async def update( if cls: return cls(pipeline_response, None, {}) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore @distributed_trace_async @@ -229,13 +248,13 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.PortalSigninSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSigninSettings :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSigninSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSigninSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSigninSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSigninSettings"] @@ -244,6 +263,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSigninSettings') @@ -252,6 +272,7 @@ async def create_or_update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -260,7 +281,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -275,5 +300,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py index 37588cdb4399..e61dccc5f7ad 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_sign_up_settings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class SignUpSettingsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -68,17 +67,24 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -94,7 +100,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore @distributed_trace_async @@ -112,7 +118,7 @@ async def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSignupSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSignupSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSignupSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSignupSettings"] @@ -121,17 +127,24 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,11 +162,11 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore @distributed_trace_async - async def update( + async def update( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -171,7 +184,7 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update Sign-Up settings. - :type parameters: ~api_management_client.models.PortalSignupSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSignupSettings :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -183,6 +196,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSignupSettings') @@ -191,6 +205,7 @@ async def update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -199,7 +214,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -210,7 +229,7 @@ async def update( if cls: return cls(pipeline_response, None, {}) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore @distributed_trace_async @@ -229,13 +248,13 @@ async def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.PortalSignupSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSignupSettings :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSignupSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSignupSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSignupSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSignupSettings"] @@ -244,6 +263,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSignupSettings') @@ -252,6 +272,7 @@ async def create_or_update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -260,7 +281,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -275,5 +300,5 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py index 247563b8f3ab..5a4f0e24b8a8 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_subscription_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class SubscriptionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -72,19 +71,21 @@ def list( 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 | | - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SubscriptionCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.SubscriptionCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.SubscriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -97,6 +98,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -111,6 +113,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -131,7 +134,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -145,7 +152,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -176,18 +183,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -203,7 +217,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace_async @@ -225,7 +239,7 @@ async def get( :type sid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -234,18 +248,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -263,7 +284,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace_async @@ -288,22 +309,22 @@ async def create_or_update( user and a product in API Management. :type sid: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.SubscriptionCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.SubscriptionCreateParameters :param notify: Notify change in Subscription State. * If false, do not send any email notification for change of state of subscription - * If true, send email notification of change of state of subscription. + * If true, send email notification of change of state of subscription. Default value is None. :type notify: bool :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -312,6 +333,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SubscriptionCreateParameters') @@ -321,6 +343,7 @@ async def create_or_update( service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, notify=notify, @@ -331,7 +354,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -355,7 +382,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace_async @@ -383,19 +410,19 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.SubscriptionUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.SubscriptionUpdateParameters :param notify: Notify change in Subscription State. * If false, do not send any email notification for change of state of subscription - * If true, send email notification of change of state of subscription. + * If true, send email notification of change of state of subscription. Default value is None. :type notify: bool :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -404,6 +431,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SubscriptionUpdateParameters') @@ -413,6 +441,7 @@ async def update( service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -423,7 +452,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -441,11 +474,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -476,19 +509,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -499,11 +539,11 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace_async - async def regenerate_primary_key( + async def regenerate_primary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -530,18 +570,25 @@ async def regenerate_primary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_primary_key_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.regenerate_primary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -552,11 +599,11 @@ async def regenerate_primary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey'} # type: ignore + regenerate_primary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey"} # type: ignore @distributed_trace_async - async def regenerate_secondary_key( + async def regenerate_secondary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -583,18 +630,25 @@ async def regenerate_secondary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_secondary_key_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.regenerate_secondary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -605,7 +659,7 @@ async def regenerate_secondary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey'} # type: ignore + regenerate_secondary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey"} # type: ignore @distributed_trace_async @@ -627,7 +681,7 @@ async def list_secrets( :type sid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionKeysContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionKeysContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionKeysContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionKeysContract"] @@ -636,18 +690,25 @@ async def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -665,5 +726,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py index 5c4d59e3d95b..2dcdb8853eee 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -24,14 +23,14 @@ T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class TagOperations: +class TagOperations: # pylint: disable=too-many-public-methods """TagOperations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -73,17 +72,20 @@ def list_by_operation( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -98,6 +100,7 @@ def prepare_request(next_link=None): api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -114,6 +117,7 @@ def prepare_request(next_link=None): api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -134,7 +138,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -148,7 +156,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags'} # type: ignore + list_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags"} # type: ignore @distributed_trace_async async def get_entity_state_by_operation( @@ -185,6 +193,8 @@ async def get_entity_state_by_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_by_operation_request( resource_group_name=resource_group_name, @@ -193,12 +203,17 @@ async def get_entity_state_by_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state_by_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -214,7 +229,7 @@ async def get_entity_state_by_operation( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + get_entity_state_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -243,7 +258,7 @@ async def get_by_operation( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -252,6 +267,8 @@ async def get_by_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_operation_request( resource_group_name=resource_group_name, @@ -260,12 +277,17 @@ async def get_by_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -283,7 +305,7 @@ async def get_by_operation( return deserialized - get_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + get_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -312,7 +334,7 @@ async def assign_to_operation( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -321,6 +343,8 @@ async def assign_to_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_assign_to_operation_request( resource_group_name=resource_group_name, @@ -329,12 +353,17 @@ async def assign_to_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.assign_to_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -353,11 +382,11 @@ async def assign_to_operation( return deserialized - assign_to_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + assign_to_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace_async - async def detach_from_operation( + async def detach_from_operation( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -391,6 +420,8 @@ async def detach_from_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_detach_from_operation_request( resource_group_name=resource_group_name, @@ -399,12 +430,17 @@ async def detach_from_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.detach_from_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -415,7 +451,7 @@ async def detach_from_operation( if cls: return cls(pipeline_response, None, {}) - detach_from_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + detach_from_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -441,17 +477,20 @@ def list_by_api( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -465,6 +504,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -480,6 +520,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -500,7 +541,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -514,7 +559,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags"} # type: ignore @distributed_trace_async async def get_entity_state_by_api( @@ -547,6 +592,8 @@ async def get_entity_state_by_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_by_api_request( resource_group_name=resource_group_name, @@ -554,12 +601,17 @@ async def get_entity_state_by_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state_by_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -575,7 +627,7 @@ async def get_entity_state_by_api( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + get_entity_state_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -600,7 +652,7 @@ async def get_by_api( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -609,6 +661,8 @@ async def get_by_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_api_request( resource_group_name=resource_group_name, @@ -616,12 +670,17 @@ async def get_by_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -639,7 +698,7 @@ async def get_by_api( return deserialized - get_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + get_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -664,7 +723,7 @@ async def assign_to_api( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -673,6 +732,8 @@ async def assign_to_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_assign_to_api_request( resource_group_name=resource_group_name, @@ -680,12 +741,17 @@ async def assign_to_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.assign_to_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -709,11 +775,11 @@ async def assign_to_api( return deserialized - assign_to_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + assign_to_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace_async - async def detach_from_api( + async def detach_from_api( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -743,6 +809,8 @@ async def detach_from_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_detach_from_api_request( resource_group_name=resource_group_name, @@ -750,12 +818,17 @@ async def detach_from_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.detach_from_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -766,7 +839,7 @@ async def detach_from_api( if cls: return cls(pipeline_response, None, {}) - detach_from_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + detach_from_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -792,17 +865,20 @@ def list_by_product( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -816,6 +892,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -831,6 +908,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -851,7 +929,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -865,7 +947,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags"} # type: ignore @distributed_trace_async async def get_entity_state_by_product( @@ -898,6 +980,8 @@ async def get_entity_state_by_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_by_product_request( resource_group_name=resource_group_name, @@ -905,12 +989,17 @@ async def get_entity_state_by_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state_by_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -926,7 +1015,7 @@ async def get_entity_state_by_product( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + get_entity_state_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -951,7 +1040,7 @@ async def get_by_product( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -960,6 +1049,8 @@ async def get_by_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_product_request( resource_group_name=resource_group_name, @@ -967,12 +1058,17 @@ async def get_by_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -990,7 +1086,7 @@ async def get_by_product( return deserialized - get_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + get_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -1015,7 +1111,7 @@ async def assign_to_product( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1024,6 +1120,8 @@ async def assign_to_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_assign_to_product_request( resource_group_name=resource_group_name, @@ -1031,12 +1129,17 @@ async def assign_to_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.assign_to_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -1055,11 +1158,11 @@ async def assign_to_product( return deserialized - assign_to_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + assign_to_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace_async - async def detach_from_product( + async def detach_from_product( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -1089,6 +1192,8 @@ async def detach_from_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_detach_from_product_request( resource_group_name=resource_group_name, @@ -1096,12 +1201,17 @@ async def detach_from_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.detach_from_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -1112,7 +1222,7 @@ async def detach_from_product( if cls: return cls(pipeline_response, None, {}) - detach_from_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + detach_from_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1136,19 +1246,21 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param scope: Scope like 'apis', 'products' or 'apis/{apiId}. + :param scope: Scope like 'apis', 'products' or 'apis/{apiId}. Default value is None. :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1161,6 +1273,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1176,6 +1289,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1197,7 +1311,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1211,7 +1329,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags"} # type: ignore @distributed_trace_async async def get_entity_state( @@ -1240,18 +1358,25 @@ async def get_entity_state( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_request( resource_group_name=resource_group_name, service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1267,7 +1392,7 @@ async def get_entity_state( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + get_entity_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -1288,7 +1413,7 @@ async def get( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1297,18 +1422,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1326,7 +1458,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -1348,13 +1480,13 @@ async def create_or_update( :param tag_id: Tag identifier. Must be unique in the current API Management service instance. :type tag_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.TagCreateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.TagCreateUpdateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1363,6 +1495,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'TagCreateUpdateParameters') @@ -1372,6 +1505,7 @@ async def create_or_update( service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -1380,7 +1514,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -1404,7 +1542,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace_async @@ -1429,10 +1567,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.TagCreateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.TagCreateUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1441,6 +1579,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'TagCreateUpdateParameters') @@ -1450,6 +1589,7 @@ async def update( service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -1458,7 +1598,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1476,11 +1620,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -1510,19 +1654,26 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -1533,5 +1684,5 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py index 1d905815a541..05bf7b6dbc87 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tag_resource_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class TagResourceOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -76,19 +74,21 @@ def list_by_service( 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 | |
. + | filter | eq | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TagResourceCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -101,6 +101,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -115,6 +116,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -135,7 +137,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,4 +155,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py index 802ddf006e4e..2bb9262322e5 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_git_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class TenantAccessGitOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace_async - async def regenerate_primary_key( + async def regenerate_primary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -59,7 +58,7 @@ async def regenerate_primary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -71,18 +70,25 @@ async def regenerate_primary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_primary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_primary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -93,11 +99,11 @@ async def regenerate_primary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey'} # type: ignore + regenerate_primary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey"} # type: ignore @distributed_trace_async - async def regenerate_secondary_key( + async def regenerate_secondary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -111,7 +117,7 @@ async def regenerate_secondary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -123,18 +129,25 @@ async def regenerate_secondary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_secondary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_secondary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -145,5 +158,5 @@ async def regenerate_secondary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'} # type: ignore + regenerate_secondary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py index 310e0cda7e5b..d50b8bd875b5 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_access_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class TenantAccessOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,15 +59,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: Not used. + :param filter: Not used. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AccessInformationCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.AccessInformationCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.AccessInformationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -81,6 +82,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=self.list_by_service.metadata['url'], ) @@ -93,6 +95,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=next_link, ) @@ -111,7 +114,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -125,7 +132,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -142,7 +149,7 @@ async def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -154,18 +161,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -181,7 +195,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace_async @@ -199,10 +213,10 @@ async def get( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] @@ -211,18 +225,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -240,7 +261,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace_async @@ -260,15 +281,15 @@ async def create( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Parameters supplied to retrieve the Tenant Access Information. - :type parameters: ~api_management_client.models.AccessInformationCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.AccessInformationCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] @@ -277,6 +298,7 @@ async def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AccessInformationCreateParameters') @@ -286,6 +308,7 @@ async def create( service_name=service_name, access_name=access_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -294,7 +317,11 @@ async def create( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -312,7 +339,7 @@ async def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace_async @@ -332,15 +359,15 @@ async def update( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Parameters supplied to retrieve the Tenant Access Information. - :type parameters: ~api_management_client.models.AccessInformationUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.AccessInformationUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] @@ -349,6 +376,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AccessInformationUpdateParameters') @@ -358,6 +386,7 @@ async def update( service_name=service_name, access_name=access_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -366,7 +395,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -384,11 +417,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace_async - async def regenerate_primary_key( + async def regenerate_primary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -402,7 +435,7 @@ async def regenerate_primary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -414,18 +447,25 @@ async def regenerate_primary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_primary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_primary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -436,11 +476,11 @@ async def regenerate_primary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey'} # type: ignore + regenerate_primary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey"} # type: ignore @distributed_trace_async - async def regenerate_secondary_key( + async def regenerate_secondary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -454,7 +494,7 @@ async def regenerate_secondary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -466,18 +506,25 @@ async def regenerate_secondary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_secondary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_secondary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -488,7 +535,7 @@ async def regenerate_secondary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey'} # type: ignore + regenerate_secondary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey"} # type: ignore @distributed_trace_async @@ -506,10 +553,10 @@ async def list_secrets( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationSecretsContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationSecretsContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationSecretsContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationSecretsContract"] @@ -518,18 +565,25 @@ async def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -547,5 +601,5 @@ async def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py index 6407d2097f13..8b1e1efbba70 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_configuration_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -31,7 +30,7 @@ class TenantConfigurationOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,6 +59,7 @@ async def _deploy_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DeployConfigurationParameters') @@ -69,6 +69,7 @@ async def _deploy_initial( service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._deploy_initial.metadata['url'], @@ -76,7 +77,11 @@ async def _deploy_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -92,7 +97,7 @@ async def _deploy_initial( return deserialized - _deploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy'} # type: ignore + _deploy_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy"} # type: ignore @distributed_trace_async @@ -112,9 +117,9 @@ async def begin_deploy( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :param parameters: Deploy Configuration parameters. - :type parameters: ~api_management_client.models.DeployConfigurationParameters + :type parameters: ~azure.mgmt.apimanagement.models.DeployConfigurationParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -126,11 +131,12 @@ async def begin_deploy( :return: An instance of AsyncLROPoller that returns either OperationResultContract or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.OperationResultContract] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.OperationResultContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -143,6 +149,7 @@ async def begin_deploy( service_name=service_name, configuration_name=configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -167,10 +174,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_deploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy'} # type: ignore + begin_deploy.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy"} # type: ignore async def _save_initial( self, @@ -186,6 +192,7 @@ async def _save_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SaveConfigurationParameter') @@ -195,6 +202,7 @@ async def _save_initial( service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._save_initial.metadata['url'], @@ -202,7 +210,11 @@ async def _save_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -218,7 +230,7 @@ async def _save_initial( return deserialized - _save_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save'} # type: ignore + _save_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save"} # type: ignore @distributed_trace_async @@ -238,9 +250,9 @@ async def begin_save( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :param parameters: Save Configuration parameters. - :type parameters: ~api_management_client.models.SaveConfigurationParameter + :type parameters: ~azure.mgmt.apimanagement.models.SaveConfigurationParameter :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -252,11 +264,12 @@ async def begin_save( :return: An instance of AsyncLROPoller that returns either OperationResultContract or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.OperationResultContract] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.OperationResultContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -269,6 +282,7 @@ async def begin_save( service_name=service_name, configuration_name=configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -293,10 +307,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_save.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save'} # type: ignore + begin_save.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save"} # type: ignore async def _validate_initial( self, @@ -312,6 +325,7 @@ async def _validate_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DeployConfigurationParameters') @@ -321,6 +335,7 @@ async def _validate_initial( service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._validate_initial.metadata['url'], @@ -328,7 +343,11 @@ async def _validate_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -344,7 +363,7 @@ async def _validate_initial( return deserialized - _validate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate'} # type: ignore + _validate_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate"} # type: ignore @distributed_trace_async @@ -364,9 +383,9 @@ async def begin_validate( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :param parameters: Validate Configuration parameters. - :type parameters: ~api_management_client.models.DeployConfigurationParameters + :type parameters: ~azure.mgmt.apimanagement.models.DeployConfigurationParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for @@ -378,11 +397,12 @@ async def begin_validate( :return: An instance of AsyncLROPoller that returns either OperationResultContract or the result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~api_management_client.models.OperationResultContract] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.apimanagement.models.OperationResultContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -395,6 +415,7 @@ async def begin_validate( service_name=service_name, configuration_name=configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -419,10 +440,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate'} # type: ignore + begin_validate.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate"} # type: ignore @distributed_trace_async async def get_sync_state( @@ -440,10 +460,10 @@ async def get_sync_state( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: TenantConfigurationSyncStateContract, or the result of cls(response) - :rtype: ~api_management_client.models.TenantConfigurationSyncStateContract + :rtype: ~azure.mgmt.apimanagement.models.TenantConfigurationSyncStateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantConfigurationSyncStateContract"] @@ -452,18 +472,25 @@ async def get_sync_state( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_sync_state_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, template_url=self.get_sync_state.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -478,5 +505,5 @@ async def get_sync_state( return deserialized - get_sync_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState'} # type: ignore + get_sync_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py index 942d49f3f2d5..b5a8a9b1da06 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_tenant_settings_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class TenantSettingsOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,15 +59,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: Not used. + :param filter: Not used. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TenantSettingsCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.TenantSettingsCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.TenantSettingsCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -81,6 +82,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=self.list_by_service.metadata['url'], ) @@ -93,6 +95,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=next_link, ) @@ -111,7 +114,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -125,7 +132,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings"} # type: ignore @distributed_trace_async async def get( @@ -142,10 +149,10 @@ async def get( :param service_name: The name of the API Management service. :type service_name: str :param settings_type: The identifier of the settings. - :type settings_type: str or ~api_management_client.models.SettingsTypeName + :type settings_type: str or ~azure.mgmt.apimanagement.models.SettingsTypeName :keyword callable cls: A custom type or function that will be passed the direct response :return: TenantSettingsContract, or the result of cls(response) - :rtype: ~api_management_client.models.TenantSettingsContract + :rtype: ~azure.mgmt.apimanagement.models.TenantSettingsContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsContract"] @@ -154,18 +161,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, settings_type=settings_type, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -183,5 +197,5 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py index 77393221ff69..b80b0a3d3c56 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_confirmation_password_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -29,7 +28,7 @@ class UserConfirmationPasswordOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -45,7 +44,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._config = config @distributed_trace_async - async def send( + async def send( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -63,7 +62,7 @@ async def send( :type user_id: str :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -75,19 +74,26 @@ async def send( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_send_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, app_type=app_type, template_url=self.send.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -98,5 +104,5 @@ async def send( if cls: return cls(pipeline_response, None, {}) - send.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send'} # type: ignore + send.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py index 999bdde3666b..79fbd2867421 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_group_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class UserGroupOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -71,17 +69,20 @@ def list( filter | ge, le, eq, ne, gt, lt | substringof, contains, 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 |
. + endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GroupCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.GroupCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.GroupCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -95,6 +96,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -110,6 +112,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -130,7 +133,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -144,4 +151,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py index 8f42f24c06d6..042e07a58184 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_identities_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -15,7 +14,6 @@ from azure.core.pipeline.transport import AsyncHttpResponse from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async from azure.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models @@ -31,7 +29,7 @@ class UserIdentitiesOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -66,9 +64,11 @@ def list( :return: An iterator like instance of either UserIdentityCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.UserIdentityCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.UserIdentityCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserIdentityCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -82,6 +82,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -94,6 +95,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -111,7 +113,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -125,4 +131,4 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py index f51f16963a15..95b9c204cd74 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar, Union from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class UserOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -71,19 +70,22 @@ def list_by_service( |
| 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 | | |
. + |
| groups | expand | | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param expand_groups: Detailed Group in response. + :param expand_groups: Detailed Group in response. Default value is None. :type expand_groups: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either UserCollection or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.UserCollection] + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.UserCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -96,6 +98,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -111,6 +114,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -132,7 +136,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -146,7 +154,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users"} # type: ignore @distributed_trace_async async def get_entity_tag( @@ -175,18 +183,25 @@ async def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -202,7 +217,7 @@ async def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace_async @@ -223,7 +238,7 @@ async def get( :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -232,18 +247,25 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -261,7 +283,7 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace_async @@ -284,15 +306,15 @@ async def create_or_update( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.UserCreateParameters - :param notify: Send an Email notification to the User. + :type parameters: ~azure.mgmt.apimanagement.models.UserCreateParameters + :param notify: Send an Email notification to the User. Default value is None. :type notify: bool :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -301,6 +323,7 @@ async def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'UserCreateParameters') @@ -310,6 +333,7 @@ async def create_or_update( service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, notify=notify, @@ -319,7 +343,11 @@ async def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -343,7 +371,7 @@ async def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace_async @@ -368,10 +396,10 @@ async def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.UserUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.UserUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -380,6 +408,7 @@ async def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'UserUpdateParameters') @@ -389,6 +418,7 @@ async def update( service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -397,7 +427,11 @@ async def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -415,11 +449,11 @@ async def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace_async - async def delete( + async def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -441,13 +475,14 @@ async def delete( :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 delete_subscriptions: Whether to delete user's subscription or not. + :param delete_subscriptions: Whether to delete user's subscription or not. Default value is + None. :type delete_subscriptions: bool - :param notify: Send an Account Closed Email notification to the User. + :param notify: Send an Account Closed Email notification to the User. Default value is None. :type notify: bool :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -459,12 +494,15 @@ async def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, delete_subscriptions=delete_subscriptions, notify=notify, @@ -474,7 +512,11 @@ async def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -485,7 +527,7 @@ async def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace_async @@ -507,7 +549,7 @@ async def generate_sso_url( :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GenerateSsoUrlResult, or the result of cls(response) - :rtype: ~api_management_client.models.GenerateSsoUrlResult + :rtype: ~azure.mgmt.apimanagement.models.GenerateSsoUrlResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateSsoUrlResult"] @@ -516,18 +558,25 @@ async def generate_sso_url( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_generate_sso_url_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.generate_sso_url.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -542,7 +591,7 @@ async def generate_sso_url( return deserialized - generate_sso_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl'} # type: ignore + generate_sso_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl"} # type: ignore @distributed_trace_async @@ -563,10 +612,10 @@ async def get_shared_access_token( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :param parameters: Create Authorization Token parameters. - :type parameters: ~api_management_client.models.UserTokenParameters + :type parameters: ~azure.mgmt.apimanagement.models.UserTokenParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: UserTokenResult, or the result of cls(response) - :rtype: ~api_management_client.models.UserTokenResult + :rtype: ~azure.mgmt.apimanagement.models.UserTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserTokenResult"] @@ -575,6 +624,7 @@ async def get_shared_access_token( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'UserTokenParameters') @@ -584,6 +634,7 @@ async def get_shared_access_token( service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.get_shared_access_token.metadata['url'], @@ -591,7 +642,11 @@ async def get_shared_access_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -606,5 +661,5 @@ async def get_shared_access_token( return deserialized - get_shared_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token'} # type: ignore + get_shared_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py index 91eadd808aed..f999762eb226 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/aio/operations/_user_subscription_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,7 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error @@ -31,7 +30,7 @@ class UserSubscriptionOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -74,19 +73,21 @@ def list( 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 |
. + contains, startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SubscriptionCollection or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~api_management_client.models.SubscriptionCollection] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.apimanagement.models.SubscriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -100,6 +101,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -115,6 +117,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -135,7 +138,11 @@ async def extract_data(pipeline_response): async def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -149,7 +156,7 @@ async def get_next(next_link=None): return AsyncItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions"} # type: ignore @distributed_trace_async async def get( @@ -173,7 +180,7 @@ async def get( :type sid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -182,6 +189,8 @@ async def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -189,12 +198,17 @@ async def get( user_id=user_id, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -212,5 +226,5 @@ async def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py index 37a29aafe06d..e0eb650b7bef 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 @@ -21,7 +21,7 @@ class AccessInformationCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.AccessInformationContract] + :vartype value: list[~azure.mgmt.apimanagement.models.AccessInformationContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -295,7 +295,7 @@ class AdditionalLocation(msrest.serialization.Model): regions. :vartype location: str :ivar sku: Required. SKU properties of the API Management service. - :vartype sku: ~api_management_client.models.ApiManagementServiceSkuProperties + :vartype sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties :ivar zones: A list of availability zones denoting where the resource needs to come from. :vartype zones: list[str] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management @@ -312,7 +312,7 @@ class AdditionalLocation(msrest.serialization.Model): :vartype public_ip_address_id: str :ivar virtual_network_configuration: Virtual network configuration for the location. :vartype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :ivar gateway_regional_url: Gateway URL of the API Management service in the Region. :vartype gateway_regional_url: str :ivar disable_gateway: Property only valid for an Api Management service deployed in multiple @@ -320,7 +320,7 @@ class AdditionalLocation(msrest.serialization.Model): :vartype disable_gateway: bool :ivar platform_version: Compute Platform Version running the service. Possible values include: "undetermined", "stv1", "stv2", "mtv1". - :vartype platform_version: str or ~api_management_client.models.PlatformVersion + :vartype platform_version: str or ~azure.mgmt.apimanagement.models.PlatformVersion """ _validation = { @@ -361,7 +361,7 @@ def __init__( regions. :paramtype location: str :keyword sku: Required. SKU properties of the API Management service. - :paramtype sku: ~api_management_client.models.ApiManagementServiceSkuProperties + :paramtype sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties :keyword zones: A list of availability zones denoting where the resource needs to come from. :paramtype zones: list[str] :keyword public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with @@ -370,7 +370,7 @@ def __init__( :paramtype public_ip_address_id: str :keyword virtual_network_configuration: Virtual network configuration for the location. :paramtype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :keyword disable_gateway: Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location. :paramtype disable_gateway: bool @@ -394,7 +394,7 @@ class ApiCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.ApiContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ApiContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -485,12 +485,13 @@ class ApiContract(Resource): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -513,9 +514,9 @@ class ApiContract(Resource): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :ivar source_api_id: API identifier of the source API. :vartype source_api_id: str :ivar display_name: API name. Must be 1 to 300 characters long. @@ -528,9 +529,9 @@ class ApiContract(Resource): the service instance creation to form a public URL for this API. :vartype path: str :ivar protocols: Describes on which protocols the operations in this API can be invoked. - :vartype protocols: list[str or ~api_management_client.models.Protocol] + :vartype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :ivar api_version_set: Version set details. - :vartype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :vartype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails """ _validation = { @@ -604,13 +605,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -631,9 +632,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :keyword source_api_id: API identifier of the source API. :paramtype source_api_id: str :keyword display_name: API name. Must be 1 to 300 characters long. @@ -646,9 +647,9 @@ def __init__( during the service instance creation to form a public URL for this API. :paramtype path: str :keyword protocols: Describes on which protocols the operations in this API can be invoked. - :paramtype protocols: list[str or ~api_management_client.models.Protocol] + :paramtype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :keyword api_version_set: Version set details. - :paramtype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :paramtype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails """ super(ApiContract, self).__init__(**kwargs) self.description = description @@ -682,12 +683,13 @@ class ApiEntityBaseContract(msrest.serialization.Model): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -710,9 +712,9 @@ class ApiEntityBaseContract(msrest.serialization.Model): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation """ _validation = { @@ -765,13 +767,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -792,9 +794,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation """ super(ApiEntityBaseContract, self).__init__(**kwargs) self.description = description @@ -824,12 +826,13 @@ class ApiContractProperties(ApiEntityBaseContract): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -852,9 +855,9 @@ class ApiContractProperties(ApiEntityBaseContract): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :ivar source_api_id: API identifier of the source API. :vartype source_api_id: str :ivar display_name: API name. Must be 1 to 300 characters long. @@ -867,9 +870,9 @@ class ApiContractProperties(ApiEntityBaseContract): specified during the service instance creation to form a public URL for this API. :vartype path: str :ivar protocols: Describes on which protocols the operations in this API can be invoked. - :vartype protocols: list[str or ~api_management_client.models.Protocol] + :vartype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :ivar api_version_set: Version set details. - :vartype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :vartype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails """ _validation = { @@ -937,13 +940,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -964,9 +967,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :keyword source_api_id: API identifier of the source API. :paramtype source_api_id: str :keyword display_name: API name. Must be 1 to 300 characters long. @@ -979,9 +982,9 @@ def __init__( specified during the service instance creation to form a public URL for this API. :paramtype path: str :keyword protocols: Describes on which protocols the operations in this API can be invoked. - :paramtype protocols: list[str or ~api_management_client.models.Protocol] + :paramtype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :keyword api_version_set: Version set details. - :paramtype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :paramtype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails """ super(ApiContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, **kwargs) self.source_api_id = source_api_id @@ -1000,12 +1003,13 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -1028,9 +1032,9 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :ivar display_name: API name. :vartype display_name: str :ivar service_url: Absolute URL of the backend service implementing this API. @@ -1040,7 +1044,7 @@ class ApiContractUpdateProperties(ApiEntityBaseContract): the service instance creation to form a public URL for this API. :vartype path: str :ivar protocols: Describes on which protocols the operations in this API can be invoked. - :vartype protocols: list[str or ~api_management_client.models.Protocol] + :vartype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] """ _validation = { @@ -1104,13 +1108,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -1131,9 +1135,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :keyword display_name: API name. :paramtype display_name: str :keyword service_url: Absolute URL of the backend service implementing this API. @@ -1143,7 +1147,7 @@ def __init__( during the service instance creation to form a public URL for this API. :paramtype path: str :keyword protocols: Describes on which protocols the operations in this API can be invoked. - :paramtype protocols: list[str or ~api_management_client.models.Protocol] + :paramtype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] """ super(ApiContractUpdateProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, **kwargs) self.display_name = display_name @@ -1160,12 +1164,13 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -1188,9 +1193,9 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :ivar source_api_id: API identifier of the source API. :vartype source_api_id: str :ivar display_name: API name. Must be 1 to 300 characters long. @@ -1203,17 +1208,18 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): the service instance creation to form a public URL for this API. :vartype path: str :ivar protocols: Describes on which protocols the operations in this API can be invoked. - :vartype protocols: list[str or ~api_management_client.models.Protocol] + :vartype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :ivar api_version_set: Version set details. - :vartype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :vartype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails :ivar value: Content value when Importing an API. :vartype value: str :ivar format: Format of the Content in which the API is getting imported. Possible values include: "wadl-xml", "wadl-link-json", "swagger-json", "swagger-link-json", "wsdl", "wsdl-link", "openapi", "openapi+json", "openapi-link", "openapi+json-link", "graphql-link". - :vartype format: str or ~api_management_client.models.ContentFormat + :vartype format: str or ~azure.mgmt.apimanagement.models.ContentFormat :ivar wsdl_selector: Criteria to limit import of WSDL to a subset of the document. - :vartype wsdl_selector: ~api_management_client.models.ApiCreateOrUpdatePropertiesWsdlSelector + :vartype wsdl_selector: + ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector :ivar soap_api_type: Type of API to create. @@ -1222,7 +1228,7 @@ class ApiCreateOrUpdateParameter(msrest.serialization.Model): * ``websocket`` creates websocket API * ``graphql`` creates GraphQL API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype soap_api_type: str or ~api_management_client.models.SoapApiType + :vartype soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ _validation = { @@ -1298,13 +1304,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -1325,9 +1331,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :keyword source_api_id: API identifier of the source API. :paramtype source_api_id: str :keyword display_name: API name. Must be 1 to 300 characters long. @@ -1340,17 +1346,18 @@ def __init__( during the service instance creation to form a public URL for this API. :paramtype path: str :keyword protocols: Describes on which protocols the operations in this API can be invoked. - :paramtype protocols: list[str or ~api_management_client.models.Protocol] + :paramtype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :keyword api_version_set: Version set details. - :paramtype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :paramtype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails :keyword value: Content value when Importing an API. :paramtype value: str :keyword format: Format of the Content in which the API is getting imported. Possible values include: "wadl-xml", "wadl-link-json", "swagger-json", "swagger-link-json", "wsdl", "wsdl-link", "openapi", "openapi+json", "openapi-link", "openapi+json-link", "graphql-link". - :paramtype format: str or ~api_management_client.models.ContentFormat + :paramtype format: str or ~azure.mgmt.apimanagement.models.ContentFormat :keyword wsdl_selector: Criteria to limit import of WSDL to a subset of the document. - :paramtype wsdl_selector: ~api_management_client.models.ApiCreateOrUpdatePropertiesWsdlSelector + :paramtype wsdl_selector: + ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector :keyword soap_api_type: Type of API to create. @@ -1359,7 +1366,7 @@ def __init__( * ``websocket`` creates websocket API * ``graphql`` creates GraphQL API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype soap_api_type: str or ~api_management_client.models.SoapApiType + :paramtype soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ super(ApiCreateOrUpdateParameter, self).__init__(**kwargs) self.description = description @@ -1399,12 +1406,13 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -1427,9 +1435,9 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :ivar source_api_id: API identifier of the source API. :vartype source_api_id: str :ivar display_name: API name. Must be 1 to 300 characters long. @@ -1442,17 +1450,18 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): specified during the service instance creation to form a public URL for this API. :vartype path: str :ivar protocols: Describes on which protocols the operations in this API can be invoked. - :vartype protocols: list[str or ~api_management_client.models.Protocol] + :vartype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :ivar api_version_set: Version set details. - :vartype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :vartype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails :ivar value: Content value when Importing an API. :vartype value: str :ivar format: Format of the Content in which the API is getting imported. Possible values include: "wadl-xml", "wadl-link-json", "swagger-json", "swagger-link-json", "wsdl", "wsdl-link", "openapi", "openapi+json", "openapi-link", "openapi+json-link", "graphql-link". - :vartype format: str or ~api_management_client.models.ContentFormat + :vartype format: str or ~azure.mgmt.apimanagement.models.ContentFormat :ivar wsdl_selector: Criteria to limit import of WSDL to a subset of the document. - :vartype wsdl_selector: ~api_management_client.models.ApiCreateOrUpdatePropertiesWsdlSelector + :vartype wsdl_selector: + ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector :ivar soap_api_type: Type of API to create. @@ -1461,7 +1470,7 @@ class ApiCreateOrUpdateProperties(ApiContractProperties): * ``websocket`` creates websocket API * ``graphql`` creates GraphQL API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype soap_api_type: str or ~api_management_client.models.SoapApiType + :vartype soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ _validation = { @@ -1537,13 +1546,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -1564,9 +1573,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :keyword source_api_id: API identifier of the source API. :paramtype source_api_id: str :keyword display_name: API name. Must be 1 to 300 characters long. @@ -1579,17 +1588,18 @@ def __init__( specified during the service instance creation to form a public URL for this API. :paramtype path: str :keyword protocols: Describes on which protocols the operations in this API can be invoked. - :paramtype protocols: list[str or ~api_management_client.models.Protocol] + :paramtype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] :keyword api_version_set: Version set details. - :paramtype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :paramtype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails :keyword value: Content value when Importing an API. :paramtype value: str :keyword format: Format of the Content in which the API is getting imported. Possible values include: "wadl-xml", "wadl-link-json", "swagger-json", "swagger-link-json", "wsdl", "wsdl-link", "openapi", "openapi+json", "openapi-link", "openapi+json-link", "graphql-link". - :paramtype format: str or ~api_management_client.models.ContentFormat + :paramtype format: str or ~azure.mgmt.apimanagement.models.ContentFormat :keyword wsdl_selector: Criteria to limit import of WSDL to a subset of the document. - :paramtype wsdl_selector: ~api_management_client.models.ApiCreateOrUpdatePropertiesWsdlSelector + :paramtype wsdl_selector: + ~azure.mgmt.apimanagement.models.ApiCreateOrUpdatePropertiesWsdlSelector :keyword soap_api_type: Type of API to create. @@ -1598,7 +1608,7 @@ def __init__( * ``websocket`` creates websocket API * ``graphql`` creates GraphQL API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype soap_api_type: str or ~api_management_client.models.SoapApiType + :paramtype soap_api_type: str or ~azure.mgmt.apimanagement.models.SoapApiType """ super(ApiCreateOrUpdateProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, source_api_id=source_api_id, display_name=display_name, service_url=service_url, path=path, protocols=protocols, api_version_set=api_version_set, **kwargs) self.value = value @@ -1647,9 +1657,9 @@ class ApiExportResult(msrest.serialization.Model): :ivar export_result_format: Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: "swagger-link-json", "wsdl-link+xml", "wadl-link-json", "openapi-link". - :vartype export_result_format: str or ~api_management_client.models.ExportResultFormat + :vartype export_result_format: str or ~azure.mgmt.apimanagement.models.ExportResultFormat :ivar value: The object defining the schema of the exported API Detail. - :vartype value: ~api_management_client.models.ApiExportResultValue + :vartype value: ~azure.mgmt.apimanagement.models.ApiExportResultValue """ _attribute_map = { @@ -1672,9 +1682,9 @@ def __init__( :keyword export_result_format: Format in which the API Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: "swagger-link-json", "wsdl-link+xml", "wadl-link-json", "openapi-link". - :paramtype export_result_format: str or ~api_management_client.models.ExportResultFormat + :paramtype export_result_format: str or ~azure.mgmt.apimanagement.models.ExportResultFormat :keyword value: The object defining the schema of the exported API Detail. - :paramtype value: ~api_management_client.models.ApiExportResultValue + :paramtype value: ~azure.mgmt.apimanagement.models.ApiExportResultValue """ super(ApiExportResult, self).__init__(**kwargs) self.id = id @@ -1784,7 +1794,7 @@ class ApiManagementServiceBackupRestoreParameters(msrest.serialization.Model): :ivar access_type: The type of access to be used for the storage account. Possible values include: "AccessKey", "SystemAssignedManagedIdentity", "UserAssignedManagedIdentity". Default value: "AccessKey". - :vartype access_type: str or ~api_management_client.models.AccessType + :vartype access_type: str or ~azure.mgmt.apimanagement.models.AccessType :ivar access_key: Storage account access key. Required only if ``accessType`` is set to ``AccessKey``. :vartype access_key: str @@ -1831,7 +1841,7 @@ def __init__( :keyword access_type: The type of access to be used for the storage account. Possible values include: "AccessKey", "SystemAssignedManagedIdentity", "UserAssignedManagedIdentity". Default value: "AccessKey". - :paramtype access_type: str or ~api_management_client.models.AccessType + :paramtype access_type: str or ~azure.mgmt.apimanagement.models.AccessType :keyword access_key: Storage account access key. Required only if ``accessType`` is set to ``AccessKey``. :paramtype access_key: str @@ -1878,7 +1888,7 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): :ivar developer_portal_url: DEveloper Portal endpoint URL of the API Management service. :vartype developer_portal_url: str :ivar hostname_configurations: Custom hostname configuration of the API Management service. - :vartype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :vartype hostname_configurations: list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. :vartype public_ip_addresses: list[str] @@ -1894,13 +1904,13 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :ivar virtual_network_configuration: Virtual network configuration of the API Management service. :vartype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :ivar additional_locations: Additional datacenter locations of the API Management service. - :vartype additional_locations: list[~api_management_client.models.AdditionalLocation] + :vartype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :ivar custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -1931,7 +1941,7 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): :vartype custom_properties: dict[str, str] :ivar certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :vartype certificates: list[~api_management_client.models.CertificateConfiguration] + :vartype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :ivar enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -1945,19 +1955,19 @@ class ApiManagementServiceBaseProperties(msrest.serialization.Model): an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :vartype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :vartype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :ivar api_version_constraint: Control Plane Apis version constraint for the API Management service. - :vartype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :vartype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :ivar 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. :vartype restore: bool :ivar private_endpoint_connections: List of Private Endpoint Connections of this service. :vartype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :ivar platform_version: Compute Platform Version running the service in this location. Possible values include: "undetermined", "stv1", "stv2", "mtv1". - :vartype platform_version: str or ~api_management_client.models.PlatformVersion + :vartype platform_version: str or ~azure.mgmt.apimanagement.models.PlatformVersion """ _validation = { @@ -2028,7 +2038,8 @@ def __init__( :keyword notification_sender_email: Email address from which the notification will be sent. :paramtype notification_sender_email: str :keyword hostname_configurations: Custom hostname configuration of the API Management service. - :paramtype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :paramtype hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :keyword public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. @@ -2037,13 +2048,13 @@ def __init__( Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :keyword virtual_network_configuration: Virtual network configuration of the API Management service. :paramtype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :keyword additional_locations: Additional datacenter locations of the API Management service. - :paramtype additional_locations: list[~api_management_client.models.AdditionalLocation] + :paramtype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :keyword custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -2074,7 +2085,7 @@ def __init__( :paramtype custom_properties: dict[str, str] :keyword certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :paramtype certificates: list[~api_management_client.models.CertificateConfiguration] + :paramtype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :keyword enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -2088,16 +2099,16 @@ def __init__( an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :paramtype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :paramtype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :keyword api_version_constraint: Control Plane Apis version constraint for the API Management service. - :paramtype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :paramtype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :keyword 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. :paramtype restore: bool :keyword private_endpoint_connections: List of Private Endpoint Connections of this service. :paramtype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] """ super(ApiManagementServiceBaseProperties, self).__init__(**kwargs) self.notification_sender_email = notification_sender_email @@ -2222,7 +2233,7 @@ class ApiManagementServiceIdentity(msrest.serialization.Model): UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". - :vartype type: str or ~api_management_client.models.ApimIdentityType + :vartype type: str or ~azure.mgmt.apimanagement.models.ApimIdentityType :ivar principal_id: The principal id of the identity. :vartype principal_id: str :ivar tenant_id: The client tenant id of the identity. @@ -2233,7 +2244,7 @@ class ApiManagementServiceIdentity(msrest.serialization.Model): '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :vartype user_assigned_identities: dict[str, - ~api_management_client.models.UserIdentityProperties] + ~azure.mgmt.apimanagement.models.UserIdentityProperties] """ _validation = { @@ -2261,14 +2272,14 @@ def __init__( UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: "SystemAssigned", "UserAssigned", "SystemAssigned, UserAssigned", "None". - :paramtype type: str or ~api_management_client.models.ApimIdentityType + :paramtype type: str or ~azure.mgmt.apimanagement.models.ApimIdentityType :keyword user_assigned_identities: The list of user identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. :paramtype user_assigned_identities: dict[str, - ~api_management_client.models.UserIdentityProperties] + ~azure.mgmt.apimanagement.models.UserIdentityProperties] """ super(ApiManagementServiceIdentity, self).__init__(**kwargs) self.type = type @@ -2283,7 +2294,7 @@ class ApiManagementServiceListResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar value: Required. Result of the List API Management services operation. - :vartype value: list[~api_management_client.models.ApiManagementServiceResource] + :vartype value: list[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :ivar next_link: Link to the next set of results. Not empty if Value contains incomplete list of API Management services. :vartype next_link: str @@ -2307,7 +2318,7 @@ def __init__( ): """ :keyword value: Required. Result of the List API Management services operation. - :paramtype value: list[~api_management_client.models.ApiManagementServiceResource] + :paramtype value: list[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :keyword next_link: Link to the next set of results. Not empty if Value contains incomplete list of API Management services. :paramtype next_link: str @@ -2334,7 +2345,7 @@ class ApiManagementServiceNameAvailabilityResult(msrest.serialization.Model): requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: "Valid", "Invalid", "AlreadyExists". - :vartype reason: str or ~api_management_client.models.NameAvailabilityReason + :vartype reason: str or ~azure.mgmt.apimanagement.models.NameAvailabilityReason """ _validation = { @@ -2359,7 +2370,7 @@ def __init__( naming requirements (incorrect length, unsupported characters, etc.) AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: "Valid", "Invalid", "AlreadyExists". - :paramtype reason: str or ~api_management_client.models.NameAvailabilityReason + :paramtype reason: str or ~azure.mgmt.apimanagement.models.NameAvailabilityReason """ super(ApiManagementServiceNameAvailabilityResult, self).__init__(**kwargs) self.name_available = None @@ -2399,7 +2410,7 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): :ivar developer_portal_url: DEveloper Portal endpoint URL of the API Management service. :vartype developer_portal_url: str :ivar hostname_configurations: Custom hostname configuration of the API Management service. - :vartype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :vartype hostname_configurations: list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. :vartype public_ip_addresses: list[str] @@ -2415,13 +2426,13 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :ivar virtual_network_configuration: Virtual network configuration of the API Management service. :vartype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :ivar additional_locations: Additional datacenter locations of the API Management service. - :vartype additional_locations: list[~api_management_client.models.AdditionalLocation] + :vartype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :ivar custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -2452,7 +2463,7 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): :vartype custom_properties: dict[str, str] :ivar certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :vartype certificates: list[~api_management_client.models.CertificateConfiguration] + :vartype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :ivar enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -2466,19 +2477,19 @@ class ApiManagementServiceProperties(ApiManagementServiceBaseProperties): an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :vartype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :vartype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :ivar api_version_constraint: Control Plane Apis version constraint for the API Management service. - :vartype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :vartype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :ivar 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. :vartype restore: bool :ivar private_endpoint_connections: List of Private Endpoint Connections of this service. :vartype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :ivar platform_version: Compute Platform Version running the service in this location. Possible values include: "undetermined", "stv1", "stv2", "mtv1". - :vartype platform_version: str or ~api_management_client.models.PlatformVersion + :vartype platform_version: str or ~azure.mgmt.apimanagement.models.PlatformVersion :ivar publisher_email: Required. Publisher email. :vartype publisher_email: str :ivar publisher_name: Required. Publisher name. @@ -2559,7 +2570,8 @@ def __init__( :keyword notification_sender_email: Email address from which the notification will be sent. :paramtype notification_sender_email: str :keyword hostname_configurations: Custom hostname configuration of the API Management service. - :paramtype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :paramtype hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :keyword public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. @@ -2568,13 +2580,13 @@ def __init__( Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :keyword virtual_network_configuration: Virtual network configuration of the API Management service. :paramtype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :keyword additional_locations: Additional datacenter locations of the API Management service. - :paramtype additional_locations: list[~api_management_client.models.AdditionalLocation] + :paramtype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :keyword custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -2605,7 +2617,7 @@ def __init__( :paramtype custom_properties: dict[str, str] :keyword certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :paramtype certificates: list[~api_management_client.models.CertificateConfiguration] + :paramtype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :keyword enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -2619,16 +2631,16 @@ def __init__( an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :paramtype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :paramtype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :keyword api_version_constraint: Control Plane Apis version constraint for the API Management service. - :paramtype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :paramtype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :keyword 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. :paramtype restore: bool :keyword private_endpoint_connections: List of Private Endpoint Connections of this service. :paramtype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :keyword publisher_email: Required. Publisher email. :paramtype publisher_email: str :keyword publisher_name: Required. Publisher name. @@ -2700,11 +2712,11 @@ class ApiManagementServiceResource(ApimResource): :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar sku: Required. SKU properties of the API Management service. - :vartype sku: ~api_management_client.models.ApiManagementServiceSkuProperties + :vartype sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties :ivar identity: Managed service identity of the Api Management service. - :vartype identity: ~api_management_client.models.ApiManagementServiceIdentity + :vartype identity: ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity :ivar system_data: Metadata pertaining to creation and last modification of the resource. - :vartype system_data: ~api_management_client.models.SystemData + :vartype system_data: ~azure.mgmt.apimanagement.models.SystemData :ivar location: Required. Resource location. :vartype location: str :ivar etag: ETag of the resource. @@ -2736,7 +2748,7 @@ class ApiManagementServiceResource(ApimResource): :ivar developer_portal_url: DEveloper Portal endpoint URL of the API Management service. :vartype developer_portal_url: str :ivar hostname_configurations: Custom hostname configuration of the API Management service. - :vartype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :vartype hostname_configurations: list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. :vartype public_ip_addresses: list[str] @@ -2752,13 +2764,13 @@ class ApiManagementServiceResource(ApimResource): Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :ivar virtual_network_configuration: Virtual network configuration of the API Management service. :vartype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :ivar additional_locations: Additional datacenter locations of the API Management service. - :vartype additional_locations: list[~api_management_client.models.AdditionalLocation] + :vartype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :ivar custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -2789,7 +2801,7 @@ class ApiManagementServiceResource(ApimResource): :vartype custom_properties: dict[str, str] :ivar certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :vartype certificates: list[~api_management_client.models.CertificateConfiguration] + :vartype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :ivar enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -2803,19 +2815,19 @@ class ApiManagementServiceResource(ApimResource): an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :vartype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :vartype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :ivar api_version_constraint: Control Plane Apis version constraint for the API Management service. - :vartype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :vartype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :ivar 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. :vartype restore: bool :ivar private_endpoint_connections: List of Private Endpoint Connections of this service. :vartype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :ivar platform_version: Compute Platform Version running the service in this location. Possible values include: "undetermined", "stv1", "stv2", "mtv1". - :vartype platform_version: str or ~api_management_client.models.PlatformVersion + :vartype platform_version: str or ~azure.mgmt.apimanagement.models.PlatformVersion :ivar publisher_email: Required. Publisher email. :vartype publisher_email: str :ivar publisher_name: Required. Publisher name. @@ -2918,9 +2930,9 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] :keyword sku: Required. SKU properties of the API Management service. - :paramtype sku: ~api_management_client.models.ApiManagementServiceSkuProperties + :paramtype sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties :keyword identity: Managed service identity of the Api Management service. - :paramtype identity: ~api_management_client.models.ApiManagementServiceIdentity + :paramtype identity: ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity :keyword location: Required. Resource location. :paramtype location: str :keyword zones: A list of availability zones denoting where the resource needs to come from. @@ -2928,7 +2940,8 @@ def __init__( :keyword notification_sender_email: Email address from which the notification will be sent. :paramtype notification_sender_email: str :keyword hostname_configurations: Custom hostname configuration of the API Management service. - :paramtype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :paramtype hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :keyword public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. @@ -2937,13 +2950,13 @@ def __init__( Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :keyword virtual_network_configuration: Virtual network configuration of the API Management service. :paramtype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :keyword additional_locations: Additional datacenter locations of the API Management service. - :paramtype additional_locations: list[~api_management_client.models.AdditionalLocation] + :paramtype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :keyword custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -2974,7 +2987,7 @@ def __init__( :paramtype custom_properties: dict[str, str] :keyword certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :paramtype certificates: list[~api_management_client.models.CertificateConfiguration] + :paramtype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :keyword enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -2988,16 +3001,16 @@ def __init__( an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :paramtype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :paramtype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :keyword api_version_constraint: Control Plane Apis version constraint for the API Management service. - :paramtype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :paramtype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :keyword 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. :paramtype restore: bool :keyword private_endpoint_connections: List of Private Endpoint Connections of this service. :paramtype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :keyword publisher_email: Required. Publisher email. :paramtype publisher_email: str :keyword publisher_name: Required. Publisher name. @@ -3047,7 +3060,7 @@ class ApiManagementServiceSkuProperties(msrest.serialization.Model): :ivar name: Required. Name of the Sku. Possible values include: "Developer", "Standard", "Premium", "Basic", "Consumption", "Isolated". - :vartype name: str or ~api_management_client.models.SkuType + :vartype name: str or ~azure.mgmt.apimanagement.models.SkuType :ivar capacity: Required. Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. :vartype capacity: int @@ -3073,7 +3086,7 @@ def __init__( """ :keyword name: Required. Name of the Sku. Possible values include: "Developer", "Standard", "Premium", "Basic", "Consumption", "Isolated". - :paramtype name: str or ~api_management_client.models.SkuType + :paramtype name: str or ~azure.mgmt.apimanagement.models.SkuType :keyword capacity: Required. Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. :paramtype capacity: int @@ -3097,9 +3110,9 @@ class ApiManagementServiceUpdateParameters(ApimResource): :ivar tags: A set of tags. Resource tags. :vartype tags: dict[str, str] :ivar sku: SKU properties of the API Management service. - :vartype sku: ~api_management_client.models.ApiManagementServiceSkuProperties + :vartype sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties :ivar identity: Managed service identity of the Api Management service. - :vartype identity: ~api_management_client.models.ApiManagementServiceIdentity + :vartype identity: ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity :ivar etag: ETag of the resource. :vartype etag: str :ivar zones: A list of availability zones denoting where the resource needs to come from. @@ -3129,7 +3142,7 @@ class ApiManagementServiceUpdateParameters(ApimResource): :ivar developer_portal_url: DEveloper Portal endpoint URL of the API Management service. :vartype developer_portal_url: str :ivar hostname_configurations: Custom hostname configuration of the API Management service. - :vartype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :vartype hostname_configurations: list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. :vartype public_ip_addresses: list[str] @@ -3145,13 +3158,13 @@ class ApiManagementServiceUpdateParameters(ApimResource): Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :ivar virtual_network_configuration: Virtual network configuration of the API Management service. :vartype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :ivar additional_locations: Additional datacenter locations of the API Management service. - :vartype additional_locations: list[~api_management_client.models.AdditionalLocation] + :vartype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :ivar custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -3182,7 +3195,7 @@ class ApiManagementServiceUpdateParameters(ApimResource): :vartype custom_properties: dict[str, str] :ivar certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :vartype certificates: list[~api_management_client.models.CertificateConfiguration] + :vartype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :ivar enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -3196,19 +3209,19 @@ class ApiManagementServiceUpdateParameters(ApimResource): an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :vartype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :vartype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :ivar api_version_constraint: Control Plane Apis version constraint for the API Management service. - :vartype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :vartype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :ivar 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. :vartype restore: bool :ivar private_endpoint_connections: List of Private Endpoint Connections of this service. :vartype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :ivar platform_version: Compute Platform Version running the service in this location. Possible values include: "undetermined", "stv1", "stv2", "mtv1". - :vartype platform_version: str or ~api_management_client.models.PlatformVersion + :vartype platform_version: str or ~azure.mgmt.apimanagement.models.PlatformVersion :ivar publisher_email: Publisher email. :vartype publisher_email: str :ivar publisher_name: Publisher name. @@ -3305,15 +3318,16 @@ def __init__( :keyword tags: A set of tags. Resource tags. :paramtype tags: dict[str, str] :keyword sku: SKU properties of the API Management service. - :paramtype sku: ~api_management_client.models.ApiManagementServiceSkuProperties + :paramtype sku: ~azure.mgmt.apimanagement.models.ApiManagementServiceSkuProperties :keyword identity: Managed service identity of the Api Management service. - :paramtype identity: ~api_management_client.models.ApiManagementServiceIdentity + :paramtype identity: ~azure.mgmt.apimanagement.models.ApiManagementServiceIdentity :keyword zones: A list of availability zones denoting where the resource needs to come from. :paramtype zones: list[str] :keyword notification_sender_email: Email address from which the notification will be sent. :paramtype notification_sender_email: str :keyword hostname_configurations: Custom hostname configuration of the API Management service. - :paramtype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :paramtype hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :keyword public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. @@ -3322,13 +3336,13 @@ def __init__( Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :keyword virtual_network_configuration: Virtual network configuration of the API Management service. :paramtype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :keyword additional_locations: Additional datacenter locations of the API Management service. - :paramtype additional_locations: list[~api_management_client.models.AdditionalLocation] + :paramtype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :keyword custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -3359,7 +3373,7 @@ def __init__( :paramtype custom_properties: dict[str, str] :keyword certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :paramtype certificates: list[~api_management_client.models.CertificateConfiguration] + :paramtype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :keyword enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -3373,16 +3387,16 @@ def __init__( an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :paramtype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :paramtype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :keyword api_version_constraint: Control Plane Apis version constraint for the API Management service. - :paramtype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :paramtype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :keyword 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. :paramtype restore: bool :keyword private_endpoint_connections: List of Private Endpoint Connections of this service. :paramtype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :keyword publisher_email: Publisher email. :paramtype publisher_email: str :keyword publisher_name: Publisher name. @@ -3453,7 +3467,7 @@ class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): :ivar developer_portal_url: DEveloper Portal endpoint URL of the API Management service. :vartype developer_portal_url: str :ivar hostname_configurations: Custom hostname configuration of the API Management service. - :vartype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :vartype hostname_configurations: list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :ivar public_ip_addresses: Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard, Premium and Isolated SKU. :vartype public_ip_addresses: list[str] @@ -3469,13 +3483,13 @@ class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :vartype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :vartype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :ivar virtual_network_configuration: Virtual network configuration of the API Management service. :vartype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :ivar additional_locations: Additional datacenter locations of the API Management service. - :vartype additional_locations: list[~api_management_client.models.AdditionalLocation] + :vartype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :ivar custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -3506,7 +3520,7 @@ class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): :vartype custom_properties: dict[str, str] :ivar certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :vartype certificates: list[~api_management_client.models.CertificateConfiguration] + :vartype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :ivar enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -3520,19 +3534,19 @@ class ApiManagementServiceUpdateProperties(ApiManagementServiceBaseProperties): an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :vartype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :vartype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :ivar api_version_constraint: Control Plane Apis version constraint for the API Management service. - :vartype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :vartype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :ivar 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. :vartype restore: bool :ivar private_endpoint_connections: List of Private Endpoint Connections of this service. :vartype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :ivar platform_version: Compute Platform Version running the service in this location. Possible values include: "undetermined", "stv1", "stv2", "mtv1". - :vartype platform_version: str or ~api_management_client.models.PlatformVersion + :vartype platform_version: str or ~azure.mgmt.apimanagement.models.PlatformVersion :ivar publisher_email: Publisher email. :vartype publisher_email: str :ivar publisher_name: Publisher name. @@ -3613,7 +3627,8 @@ def __init__( :keyword notification_sender_email: Email address from which the notification will be sent. :paramtype notification_sender_email: str :keyword hostname_configurations: Custom hostname configuration of the API Management service. - :paramtype hostname_configurations: list[~api_management_client.models.HostnameConfiguration] + :paramtype hostname_configurations: + list[~azure.mgmt.apimanagement.models.HostnameConfiguration] :keyword public_ip_address_id: Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the region. Supported only for Developer and Premium SKU being deployed in Virtual Network. @@ -3622,13 +3637,13 @@ def __init__( Management service. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled'. Possible values include: "Enabled", "Disabled". - :paramtype public_network_access: str or ~api_management_client.models.PublicNetworkAccess + :paramtype public_network_access: str or ~azure.mgmt.apimanagement.models.PublicNetworkAccess :keyword virtual_network_configuration: Virtual network configuration of the API Management service. :paramtype virtual_network_configuration: - ~api_management_client.models.VirtualNetworkConfiguration + ~azure.mgmt.apimanagement.models.VirtualNetworkConfiguration :keyword additional_locations: Additional datacenter locations of the API Management service. - :paramtype additional_locations: list[~api_management_client.models.AdditionalLocation] + :paramtype additional_locations: list[~azure.mgmt.apimanagement.models.AdditionalLocation] :keyword custom_properties: Custom properties of the API Management service.
Setting ``Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168`` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting @@ -3659,7 +3674,7 @@ def __init__( :paramtype custom_properties: dict[str, str] :keyword certificates: List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. - :paramtype certificates: list[~api_management_client.models.CertificateConfiguration] + :paramtype certificates: list[~azure.mgmt.apimanagement.models.CertificateConfiguration] :keyword enable_client_certificate: Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. @@ -3673,16 +3688,16 @@ def __init__( an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: "None", "External", "Internal". Default value: "None". - :paramtype virtual_network_type: str or ~api_management_client.models.VirtualNetworkType + :paramtype virtual_network_type: str or ~azure.mgmt.apimanagement.models.VirtualNetworkType :keyword api_version_constraint: Control Plane Apis version constraint for the API Management service. - :paramtype api_version_constraint: ~api_management_client.models.ApiVersionConstraint + :paramtype api_version_constraint: ~azure.mgmt.apimanagement.models.ApiVersionConstraint :keyword 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. :paramtype restore: bool :keyword private_endpoint_connections: List of Private Endpoint Connections of this service. :paramtype private_endpoint_connections: - list[~api_management_client.models.RemotePrivateEndpointConnectionWrapper] + list[~azure.mgmt.apimanagement.models.RemotePrivateEndpointConnectionWrapper] :keyword publisher_email: Publisher email. :paramtype publisher_email: str :keyword publisher_name: Publisher name. @@ -3713,21 +3728,21 @@ class ApiManagementSku(msrest.serialization.Model): :ivar kind: The Kind of resources that are supported in this SKU. :vartype kind: str :ivar capacity: Specifies the number of virtual machines in the scale set. - :vartype capacity: ~api_management_client.models.ApiManagementSkuCapacity + :vartype capacity: ~azure.mgmt.apimanagement.models.ApiManagementSkuCapacity :ivar locations: The set of locations that the SKU is available. :vartype locations: list[str] :ivar location_info: A list of locations and availability zones in those locations where the SKU is available. - :vartype location_info: list[~api_management_client.models.ApiManagementSkuLocationInfo] + :vartype location_info: list[~azure.mgmt.apimanagement.models.ApiManagementSkuLocationInfo] :ivar api_versions: The api versions that support this SKU. :vartype api_versions: list[str] :ivar costs: Metadata for retrieving price info. - :vartype costs: list[~api_management_client.models.ApiManagementSkuCosts] + :vartype costs: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCosts] :ivar capabilities: A name value pair to describe the capability. - :vartype capabilities: list[~api_management_client.models.ApiManagementSkuCapabilities] + :vartype capabilities: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCapabilities] :ivar restrictions: The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. - :vartype restrictions: list[~api_management_client.models.ApiManagementSkuRestrictions] + :vartype restrictions: list[~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictions] """ _validation = { @@ -3829,7 +3844,7 @@ class ApiManagementSkuCapacity(msrest.serialization.Model): :vartype default: int :ivar scale_type: The scale type applicable to the sku. Possible values include: "Automatic", "Manual", "None". - :vartype scale_type: str or ~api_management_client.models.ApiManagementSkuCapacityScaleType + :vartype scale_type: str or ~azure.mgmt.apimanagement.models.ApiManagementSkuCapacityScaleType """ _validation = { @@ -3906,7 +3921,7 @@ class ApiManagementSkuLocationInfo(msrest.serialization.Model): :ivar zones: List of availability zones where the SKU is supported. :vartype zones: list[str] :ivar zone_details: Details of capabilities available to a SKU in specific zones. - :vartype zone_details: list[~api_management_client.models.ApiManagementSkuZoneDetails] + :vartype zone_details: list[~azure.mgmt.apimanagement.models.ApiManagementSkuZoneDetails] """ _validation = { @@ -3971,16 +3986,16 @@ class ApiManagementSkuRestrictions(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar type: The type of restrictions. Possible values include: "Location", "Zone". - :vartype type: str or ~api_management_client.models.ApiManagementSkuRestrictionsType + :vartype type: str or ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionsType :ivar values: The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. :vartype values: list[str] :ivar restriction_info: The information about the restriction where the SKU cannot be used. - :vartype restriction_info: ~api_management_client.models.ApiManagementSkuRestrictionInfo + :vartype restriction_info: ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionInfo :ivar reason_code: The reason for restriction. Possible values include: "QuotaId", "NotAvailableForSubscription". :vartype reason_code: str or - ~api_management_client.models.ApiManagementSkuRestrictionsReasonCode + ~azure.mgmt.apimanagement.models.ApiManagementSkuRestrictionsReasonCode """ _validation = { @@ -4018,7 +4033,7 @@ class ApiManagementSkusResult(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar value: Required. The list of skus available for the subscription. - :vartype value: list[~api_management_client.models.ApiManagementSku] + :vartype value: list[~azure.mgmt.apimanagement.models.ApiManagementSku] :ivar next_link: The URI to fetch the next page of Resource Skus. Call ListNext() with this URI to fetch the next page of Resource Skus. :vartype next_link: str @@ -4042,7 +4057,7 @@ def __init__( ): """ :keyword value: Required. The list of skus available for the subscription. - :paramtype value: list[~api_management_client.models.ApiManagementSku] + :paramtype value: list[~azure.mgmt.apimanagement.models.ApiManagementSku] """ super(ApiManagementSkusResult, self).__init__(**kwargs) self.value = value @@ -4058,7 +4073,7 @@ class ApiManagementSkuZoneDetails(msrest.serialization.Model): :vartype name: list[str] :ivar capabilities: A list of capabilities that are available for the SKU in the specified list of zones. - :vartype capabilities: list[~api_management_client.models.ApiManagementSkuCapabilities] + :vartype capabilities: list[~azure.mgmt.apimanagement.models.ApiManagementSkuCapabilities] """ _validation = { @@ -4088,7 +4103,7 @@ class ApiReleaseCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.ApiReleaseContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ApiReleaseContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -4190,7 +4205,7 @@ class ApiRevisionCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.ApiRevisionContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ApiRevisionContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -4298,7 +4313,7 @@ class ApiRevisionInfoContract(msrest.serialization.Model): :ivar api_revision_description: Description of new API Revision. :vartype api_revision_description: str :ivar api_version_set: Version set details. - :vartype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :vartype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails """ _validation = { @@ -4330,7 +4345,7 @@ def __init__( :keyword api_revision_description: Description of new API Revision. :paramtype api_revision_description: str :keyword api_version_set: Version set details. - :paramtype api_version_set: ~api_management_client.models.ApiVersionSetContractDetails + :paramtype api_version_set: ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetails """ super(ApiRevisionInfoContract, self).__init__(**kwargs) self.source_api_id = source_api_id @@ -4347,12 +4362,13 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -4375,9 +4391,9 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :ivar id: API identifier in the form /apis/{apiId}. :vartype id: str :ivar name: API name. @@ -4389,7 +4405,7 @@ class ApiTagResourceContractProperties(ApiEntityBaseContract): the service instance creation to form a public URL for this API. :vartype path: str :ivar protocols: Describes on which protocols the operations in this API can be invoked. - :vartype protocols: list[str or ~api_management_client.models.Protocol] + :vartype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] """ _validation = { @@ -4455,13 +4471,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -4482,9 +4498,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :keyword id: API identifier in the form /apis/{apiId}. :paramtype id: str :keyword name: API name. @@ -4496,7 +4512,7 @@ def __init__( during the service instance creation to form a public URL for this API. :paramtype path: str :keyword protocols: Describes on which protocols the operations in this API can be invoked. - :paramtype protocols: list[str or ~api_management_client.models.Protocol] + :paramtype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] """ super(ApiTagResourceContractProperties, self).__init__(description=description, authentication_settings=authentication_settings, subscription_key_parameter_names=subscription_key_parameter_names, api_type=api_type, api_revision=api_revision, api_version=api_version, is_current=is_current, api_revision_description=api_revision_description, api_version_description=api_version_description, api_version_set_id=api_version_set_id, subscription_required=subscription_required, terms_of_service_url=terms_of_service_url, contact=contact, license=license, **kwargs) self.id = id @@ -4514,12 +4530,13 @@ class ApiUpdateContract(msrest.serialization.Model): :ivar description: Description of the API. May include HTML formatting tags. :vartype description: str :ivar authentication_settings: Collection of authentication settings included into this API. - :vartype authentication_settings: ~api_management_client.models.AuthenticationSettingsContract + :vartype authentication_settings: + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :ivar subscription_key_parameter_names: Protocols over which API is made available. :vartype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :ivar api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :vartype api_type: str or ~api_management_client.models.ApiType + :vartype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :ivar api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :vartype api_revision: str @@ -4542,9 +4559,9 @@ class ApiUpdateContract(msrest.serialization.Model): a URL. :vartype terms_of_service_url: str :ivar contact: Contact information for the API. - :vartype contact: ~api_management_client.models.ApiContactInformation + :vartype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :ivar license: License information for the API. - :vartype license: ~api_management_client.models.ApiLicenseInformation + :vartype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :ivar display_name: API name. :vartype display_name: str :ivar service_url: Absolute URL of the backend service implementing this API. @@ -4554,7 +4571,7 @@ class ApiUpdateContract(msrest.serialization.Model): the service instance creation to form a public URL for this API. :vartype path: str :ivar protocols: Describes on which protocols the operations in this API can be invoked. - :vartype protocols: list[str or ~api_management_client.models.Protocol] + :vartype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] """ _validation = { @@ -4618,13 +4635,13 @@ def __init__( :paramtype description: str :keyword authentication_settings: Collection of authentication settings included into this API. :paramtype authentication_settings: - ~api_management_client.models.AuthenticationSettingsContract + ~azure.mgmt.apimanagement.models.AuthenticationSettingsContract :keyword subscription_key_parameter_names: Protocols over which API is made available. :paramtype subscription_key_parameter_names: - ~api_management_client.models.SubscriptionKeyParameterNamesContract + ~azure.mgmt.apimanagement.models.SubscriptionKeyParameterNamesContract :keyword api_type: Type of API. Possible values include: "http", "soap", "websocket", "graphql". - :paramtype api_type: str or ~api_management_client.models.ApiType + :paramtype api_type: str or ~azure.mgmt.apimanagement.models.ApiType :keyword api_revision: Describes the revision of the API. If no value is provided, default revision 1 is created. :paramtype api_revision: str @@ -4645,9 +4662,9 @@ def __init__( of a URL. :paramtype terms_of_service_url: str :keyword contact: Contact information for the API. - :paramtype contact: ~api_management_client.models.ApiContactInformation + :paramtype contact: ~azure.mgmt.apimanagement.models.ApiContactInformation :keyword license: License information for the API. - :paramtype license: ~api_management_client.models.ApiLicenseInformation + :paramtype license: ~azure.mgmt.apimanagement.models.ApiLicenseInformation :keyword display_name: API name. :paramtype display_name: str :keyword service_url: Absolute URL of the backend service implementing this API. @@ -4657,7 +4674,7 @@ def __init__( during the service instance creation to form a public URL for this API. :paramtype path: str :keyword protocols: Describes on which protocols the operations in this API can be invoked. - :paramtype protocols: list[str or ~api_management_client.models.Protocol] + :paramtype protocols: list[str or ~azure.mgmt.apimanagement.models.Protocol] """ super(ApiUpdateContract, self).__init__(**kwargs) self.description = description @@ -4712,7 +4729,7 @@ class ApiVersionSetCollection(msrest.serialization.Model): """Paged API Version Set list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.ApiVersionSetContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ApiVersionSetContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -4735,7 +4752,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.ApiVersionSetContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.ApiVersionSetContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -4772,7 +4789,7 @@ class ApiVersionSetContract(Resource): :vartype display_name: str :ivar versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :vartype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :vartype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ _validation = { @@ -4818,7 +4835,7 @@ def __init__( :paramtype display_name: str :keyword versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :paramtype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :paramtype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ super(ApiVersionSetContract, self).__init__(**kwargs) self.description = description @@ -4840,7 +4857,7 @@ class ApiVersionSetContractDetails(msrest.serialization.Model): :ivar versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :vartype versioning_scheme: str or - ~api_management_client.models.ApiVersionSetContractDetailsVersioningScheme + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetailsVersioningScheme :ivar version_query_name: Name of query parameter that indicates the API Version if versioningScheme is set to ``query``. :vartype version_query_name: str @@ -4880,7 +4897,7 @@ def __init__( :keyword versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". :paramtype versioning_scheme: str or - ~api_management_client.models.ApiVersionSetContractDetailsVersioningScheme + ~azure.mgmt.apimanagement.models.ApiVersionSetContractDetailsVersioningScheme :keyword version_query_name: Name of query parameter that indicates the API Version if versioningScheme is set to ``query``. :paramtype version_query_name: str @@ -4962,7 +4979,7 @@ class ApiVersionSetContractProperties(ApiVersionSetEntityBase): :vartype display_name: str :ivar versioning_scheme: Required. An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :vartype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :vartype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ _validation = { @@ -5003,7 +5020,7 @@ def __init__( :paramtype display_name: str :keyword versioning_scheme: Required. An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :paramtype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :paramtype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ super(ApiVersionSetContractProperties, self).__init__(description=description, version_query_name=version_query_name, version_header_name=version_header_name, **kwargs) self.display_name = display_name @@ -5025,7 +5042,7 @@ class ApiVersionSetUpdateParameters(msrest.serialization.Model): :vartype display_name: str :ivar versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :vartype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :vartype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ _validation = { @@ -5065,7 +5082,7 @@ def __init__( :paramtype display_name: str :keyword versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :paramtype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :paramtype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ super(ApiVersionSetUpdateParameters, self).__init__(**kwargs) self.description = description @@ -5090,7 +5107,7 @@ class ApiVersionSetUpdateParametersProperties(ApiVersionSetEntityBase): :vartype display_name: str :ivar versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :vartype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :vartype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ _validation = { @@ -5130,7 +5147,7 @@ def __init__( :paramtype display_name: str :keyword versioning_scheme: An value that determines where the API Version identifier will be located in a HTTP request. Possible values include: "Segment", "Query", "Header". - :paramtype versioning_scheme: str or ~api_management_client.models.VersioningScheme + :paramtype versioning_scheme: str or ~azure.mgmt.apimanagement.models.VersioningScheme """ super(ApiVersionSetUpdateParametersProperties, self).__init__(description=description, version_query_name=version_query_name, version_header_name=version_header_name, **kwargs) self.display_name = display_name @@ -5214,9 +5231,9 @@ class AuthenticationSettingsContract(msrest.serialization.Model): """API Authentication Settings. :ivar o_auth2: OAuth2 Authentication settings. - :vartype o_auth2: ~api_management_client.models.OAuth2AuthenticationSettingsContract + :vartype o_auth2: ~azure.mgmt.apimanagement.models.OAuth2AuthenticationSettingsContract :ivar openid: OpenID Connect Authentication Settings. - :vartype openid: ~api_management_client.models.OpenIdAuthenticationSettingsContract + :vartype openid: ~azure.mgmt.apimanagement.models.OpenIdAuthenticationSettingsContract """ _attribute_map = { @@ -5233,9 +5250,9 @@ def __init__( ): """ :keyword o_auth2: OAuth2 Authentication settings. - :paramtype o_auth2: ~api_management_client.models.OAuth2AuthenticationSettingsContract + :paramtype o_auth2: ~azure.mgmt.apimanagement.models.OAuth2AuthenticationSettingsContract :keyword openid: OpenID Connect Authentication Settings. - :paramtype openid: ~api_management_client.models.OpenIdAuthenticationSettingsContract + :paramtype openid: ~azure.mgmt.apimanagement.models.OpenIdAuthenticationSettingsContract """ super(AuthenticationSettingsContract, self).__init__(**kwargs) self.o_auth2 = o_auth2 @@ -5246,7 +5263,7 @@ class AuthorizationServerCollection(msrest.serialization.Model): """Paged OAuth2 Authorization Servers list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.AuthorizationServerContract] + :vartype value: list[~azure.mgmt.apimanagement.models.AuthorizationServerContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -5269,7 +5286,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.AuthorizationServerContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.AuthorizationServerContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -5298,17 +5315,19 @@ class AuthorizationServerContract(Resource): :vartype description: str :ivar authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. - :vartype authorization_methods: list[str or ~api_management_client.models.AuthorizationMethod] + :vartype authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :ivar client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :vartype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :ivar token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. - :vartype token_body_parameters: list[~api_management_client.models.TokenBodyParameterContract] + :vartype token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :ivar token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :vartype token_endpoint: str :ivar support_state: If true, authorization server will include state parameter from the @@ -5322,7 +5341,7 @@ class AuthorizationServerContract(Resource): :ivar bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :vartype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :ivar resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :vartype resource_owner_username: str @@ -5340,7 +5359,7 @@ class AuthorizationServerContract(Resource): :vartype authorization_endpoint: str :ivar grant_types: Form of an authorization grant, which the client uses to request the access token. - :vartype grant_types: list[str or ~api_management_client.models.GrantType] + :vartype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :ivar client_id: Client or app id registered with this authorization server. :vartype client_id: str :ivar client_secret: Client or app secret registered with this authorization server. This @@ -5406,18 +5425,18 @@ def __init__( :keyword authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. :paramtype authorization_methods: list[str or - ~api_management_client.models.AuthorizationMethod] + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :keyword client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :paramtype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :keyword token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. :paramtype token_body_parameters: - list[~api_management_client.models.TokenBodyParameterContract] + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :keyword token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :paramtype token_endpoint: str @@ -5432,7 +5451,7 @@ def __init__( :keyword bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :paramtype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :keyword resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :paramtype resource_owner_username: str @@ -5450,7 +5469,7 @@ def __init__( :paramtype authorization_endpoint: str :keyword grant_types: Form of an authorization grant, which the client uses to request the access token. - :paramtype grant_types: list[str or ~api_management_client.models.GrantType] + :paramtype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :keyword client_id: Client or app id registered with this authorization server. :paramtype client_id: str :keyword client_secret: Client or app secret registered with this authorization server. This @@ -5484,17 +5503,19 @@ class AuthorizationServerContractBaseProperties(msrest.serialization.Model): :vartype description: str :ivar authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. - :vartype authorization_methods: list[str or ~api_management_client.models.AuthorizationMethod] + :vartype authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :ivar client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :vartype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :ivar token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. - :vartype token_body_parameters: list[~api_management_client.models.TokenBodyParameterContract] + :vartype token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :ivar token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :vartype token_endpoint: str :ivar support_state: If true, authorization server will include state parameter from the @@ -5508,7 +5529,7 @@ class AuthorizationServerContractBaseProperties(msrest.serialization.Model): :ivar bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :vartype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :ivar resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :vartype resource_owner_username: str @@ -5552,18 +5573,18 @@ def __init__( :keyword authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. :paramtype authorization_methods: list[str or - ~api_management_client.models.AuthorizationMethod] + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :keyword client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :paramtype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :keyword token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. :paramtype token_body_parameters: - list[~api_management_client.models.TokenBodyParameterContract] + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :keyword token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :paramtype token_endpoint: str @@ -5578,7 +5599,7 @@ def __init__( :keyword bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :paramtype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :keyword resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :paramtype resource_owner_username: str @@ -5608,17 +5629,19 @@ class AuthorizationServerContractProperties(AuthorizationServerContractBasePrope :vartype description: str :ivar authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. - :vartype authorization_methods: list[str or ~api_management_client.models.AuthorizationMethod] + :vartype authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :ivar client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :vartype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :ivar token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. - :vartype token_body_parameters: list[~api_management_client.models.TokenBodyParameterContract] + :vartype token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :ivar token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :vartype token_endpoint: str :ivar support_state: If true, authorization server will include state parameter from the @@ -5632,7 +5655,7 @@ class AuthorizationServerContractProperties(AuthorizationServerContractBasePrope :ivar bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :vartype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :ivar resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :vartype resource_owner_username: str @@ -5650,7 +5673,7 @@ class AuthorizationServerContractProperties(AuthorizationServerContractBasePrope :vartype authorization_endpoint: str :ivar grant_types: Required. Form of an authorization grant, which the client uses to request the access token. - :vartype grant_types: list[str or ~api_management_client.models.GrantType] + :vartype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :ivar client_id: Required. Client or app id registered with this authorization server. :vartype client_id: str :ivar client_secret: Client or app secret registered with this authorization server. This @@ -5714,18 +5737,18 @@ def __init__( :keyword authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. :paramtype authorization_methods: list[str or - ~api_management_client.models.AuthorizationMethod] + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :keyword client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :paramtype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :keyword token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. :paramtype token_body_parameters: - list[~api_management_client.models.TokenBodyParameterContract] + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :keyword token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :paramtype token_endpoint: str @@ -5740,7 +5763,7 @@ def __init__( :keyword bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :paramtype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :keyword resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :paramtype resource_owner_username: str @@ -5758,7 +5781,7 @@ def __init__( :paramtype authorization_endpoint: str :keyword grant_types: Required. Form of an authorization grant, which the client uses to request the access token. - :paramtype grant_types: list[str or ~api_management_client.models.GrantType] + :paramtype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :keyword client_id: Required. Client or app id registered with this authorization server. :paramtype client_id: str :keyword client_secret: Client or app secret registered with this authorization server. This @@ -5835,17 +5858,19 @@ class AuthorizationServerUpdateContract(Resource): :vartype description: str :ivar authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. - :vartype authorization_methods: list[str or ~api_management_client.models.AuthorizationMethod] + :vartype authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :ivar client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :vartype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :ivar token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. - :vartype token_body_parameters: list[~api_management_client.models.TokenBodyParameterContract] + :vartype token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :ivar token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :vartype token_endpoint: str :ivar support_state: If true, authorization server will include state parameter from the @@ -5859,7 +5884,7 @@ class AuthorizationServerUpdateContract(Resource): :ivar bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :vartype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :ivar resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :vartype resource_owner_username: str @@ -5877,7 +5902,7 @@ class AuthorizationServerUpdateContract(Resource): :vartype authorization_endpoint: str :ivar grant_types: Form of an authorization grant, which the client uses to request the access token. - :vartype grant_types: list[str or ~api_management_client.models.GrantType] + :vartype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :ivar client_id: Client or app id registered with this authorization server. :vartype client_id: str :ivar client_secret: Client or app secret registered with this authorization server. This @@ -5943,18 +5968,18 @@ def __init__( :keyword authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. :paramtype authorization_methods: list[str or - ~api_management_client.models.AuthorizationMethod] + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :keyword client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :paramtype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :keyword token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. :paramtype token_body_parameters: - list[~api_management_client.models.TokenBodyParameterContract] + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :keyword token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :paramtype token_endpoint: str @@ -5969,7 +5994,7 @@ def __init__( :keyword bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :paramtype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :keyword resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :paramtype resource_owner_username: str @@ -5987,7 +6012,7 @@ def __init__( :paramtype authorization_endpoint: str :keyword grant_types: Form of an authorization grant, which the client uses to request the access token. - :paramtype grant_types: list[str or ~api_management_client.models.GrantType] + :paramtype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :keyword client_id: Client or app id registered with this authorization server. :paramtype client_id: str :keyword client_secret: Client or app secret registered with this authorization server. This @@ -6021,17 +6046,19 @@ class AuthorizationServerUpdateContractProperties(AuthorizationServerContractBas :vartype description: str :ivar authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. - :vartype authorization_methods: list[str or ~api_management_client.models.AuthorizationMethod] + :vartype authorization_methods: list[str or + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :ivar client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :vartype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :ivar token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. - :vartype token_body_parameters: list[~api_management_client.models.TokenBodyParameterContract] + :vartype token_body_parameters: + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :ivar token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :vartype token_endpoint: str :ivar support_state: If true, authorization server will include state parameter from the @@ -6045,7 +6072,7 @@ class AuthorizationServerUpdateContractProperties(AuthorizationServerContractBas :ivar bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :vartype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :ivar resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :vartype resource_owner_username: str @@ -6063,7 +6090,7 @@ class AuthorizationServerUpdateContractProperties(AuthorizationServerContractBas :vartype authorization_endpoint: str :ivar grant_types: Form of an authorization grant, which the client uses to request the access token. - :vartype grant_types: list[str or ~api_management_client.models.GrantType] + :vartype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :ivar client_id: Client or app id registered with this authorization server. :vartype client_id: str :ivar client_secret: Client or app secret registered with this authorization server. This @@ -6123,18 +6150,18 @@ def __init__( :keyword authorization_methods: HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. :paramtype authorization_methods: list[str or - ~api_management_client.models.AuthorizationMethod] + ~azure.mgmt.apimanagement.models.AuthorizationMethod] :keyword client_authentication_method: Method of authentication supported by the token endpoint of this authorization server. Possible values are Basic and/or Body. When Body is specified, client credentials and other parameters are passed within the request body in the application/x-www-form-urlencoded format. :paramtype client_authentication_method: list[str or - ~api_management_client.models.ClientAuthenticationMethod] + ~azure.mgmt.apimanagement.models.ClientAuthenticationMethod] :keyword token_body_parameters: Additional parameters required by the token endpoint of this authorization server represented as an array of JSON objects with name and value string properties, i.e. {"name" : "name value", "value": "a value"}. :paramtype token_body_parameters: - list[~api_management_client.models.TokenBodyParameterContract] + list[~azure.mgmt.apimanagement.models.TokenBodyParameterContract] :keyword token_endpoint: OAuth token endpoint. Contains absolute URI to entity being referenced. :paramtype token_endpoint: str @@ -6149,7 +6176,7 @@ def __init__( :keyword bearer_token_sending_methods: Specifies the mechanism by which access token is passed to the API. :paramtype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethod] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethod] :keyword resource_owner_username: Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. :paramtype resource_owner_username: str @@ -6167,7 +6194,7 @@ def __init__( :paramtype authorization_endpoint: str :keyword grant_types: Form of an authorization grant, which the client uses to request the access token. - :paramtype grant_types: list[str or ~api_management_client.models.GrantType] + :paramtype grant_types: list[str or ~azure.mgmt.apimanagement.models.GrantType] :keyword client_id: Client or app id registered with this authorization server. :paramtype client_id: str :keyword client_secret: Client or app secret registered with this authorization server. This @@ -6234,13 +6261,13 @@ class BackendBaseParameters(msrest.serialization.Model): Resource Id of Logic Apps, Function Apps or API Apps. :vartype resource_id: str :ivar properties: Backend Properties contract. - :vartype properties: ~api_management_client.models.BackendProperties + :vartype properties: ~azure.mgmt.apimanagement.models.BackendProperties :ivar credentials: Backend Credentials Contract Properties. - :vartype credentials: ~api_management_client.models.BackendCredentialsContract + :vartype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :ivar proxy: Backend Proxy Contract Properties. - :vartype proxy: ~api_management_client.models.BackendProxyContract + :vartype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :ivar tls: Backend TLS Properties. - :vartype tls: ~api_management_client.models.BackendTlsProperties + :vartype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties """ _validation = { @@ -6280,13 +6307,13 @@ def __init__( Arm Resource Id of Logic Apps, Function Apps or API Apps. :paramtype resource_id: str :keyword properties: Backend Properties contract. - :paramtype properties: ~api_management_client.models.BackendProperties + :paramtype properties: ~azure.mgmt.apimanagement.models.BackendProperties :keyword credentials: Backend Credentials Contract Properties. - :paramtype credentials: ~api_management_client.models.BackendCredentialsContract + :paramtype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :keyword proxy: Backend Proxy Contract Properties. - :paramtype proxy: ~api_management_client.models.BackendProxyContract + :paramtype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :keyword tls: Backend TLS Properties. - :paramtype tls: ~api_management_client.models.BackendTlsProperties + :paramtype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties """ super(BackendBaseParameters, self).__init__(**kwargs) self.title = title @@ -6302,7 +6329,7 @@ class BackendCollection(msrest.serialization.Model): """Paged Backend list representation. :ivar value: Backend values. - :vartype value: list[~api_management_client.models.BackendContract] + :vartype value: list[~azure.mgmt.apimanagement.models.BackendContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -6325,7 +6352,7 @@ def __init__( ): """ :keyword value: Backend values. - :paramtype value: list[~api_management_client.models.BackendContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.BackendContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -6358,17 +6385,17 @@ class BackendContract(Resource): Resource Id of Logic Apps, Function Apps or API Apps. :vartype resource_id: str :ivar properties: Backend Properties contract. - :vartype properties: ~api_management_client.models.BackendProperties + :vartype properties: ~azure.mgmt.apimanagement.models.BackendProperties :ivar credentials: Backend Credentials Contract Properties. - :vartype credentials: ~api_management_client.models.BackendCredentialsContract + :vartype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :ivar proxy: Backend Proxy Contract Properties. - :vartype proxy: ~api_management_client.models.BackendProxyContract + :vartype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :ivar tls: Backend TLS Properties. - :vartype tls: ~api_management_client.models.BackendTlsProperties + :vartype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :ivar url: Runtime Url of the Backend. :vartype url: str :ivar protocol: Backend communication protocol. Possible values include: "http", "soap". - :vartype protocol: str or ~api_management_client.models.BackendProtocol + :vartype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ _validation = { @@ -6419,17 +6446,17 @@ def __init__( Arm Resource Id of Logic Apps, Function Apps or API Apps. :paramtype resource_id: str :keyword properties: Backend Properties contract. - :paramtype properties: ~api_management_client.models.BackendProperties + :paramtype properties: ~azure.mgmt.apimanagement.models.BackendProperties :keyword credentials: Backend Credentials Contract Properties. - :paramtype credentials: ~api_management_client.models.BackendCredentialsContract + :paramtype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :keyword proxy: Backend Proxy Contract Properties. - :paramtype proxy: ~api_management_client.models.BackendProxyContract + :paramtype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :keyword tls: Backend TLS Properties. - :paramtype tls: ~api_management_client.models.BackendTlsProperties + :paramtype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :keyword url: Runtime Url of the Backend. :paramtype url: str :keyword protocol: Backend communication protocol. Possible values include: "http", "soap". - :paramtype protocol: str or ~api_management_client.models.BackendProtocol + :paramtype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ super(BackendContract, self).__init__(**kwargs) self.title = title @@ -6456,18 +6483,18 @@ class BackendContractProperties(BackendBaseParameters): Resource Id of Logic Apps, Function Apps or API Apps. :vartype resource_id: str :ivar properties: Backend Properties contract. - :vartype properties: ~api_management_client.models.BackendProperties + :vartype properties: ~azure.mgmt.apimanagement.models.BackendProperties :ivar credentials: Backend Credentials Contract Properties. - :vartype credentials: ~api_management_client.models.BackendCredentialsContract + :vartype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :ivar proxy: Backend Proxy Contract Properties. - :vartype proxy: ~api_management_client.models.BackendProxyContract + :vartype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :ivar tls: Backend TLS Properties. - :vartype tls: ~api_management_client.models.BackendTlsProperties + :vartype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :ivar url: Required. Runtime Url of the Backend. :vartype url: str :ivar protocol: Required. Backend communication protocol. Possible values include: "http", "soap". - :vartype protocol: str or ~api_management_client.models.BackendProtocol + :vartype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ _validation = { @@ -6513,18 +6540,18 @@ def __init__( Arm Resource Id of Logic Apps, Function Apps or API Apps. :paramtype resource_id: str :keyword properties: Backend Properties contract. - :paramtype properties: ~api_management_client.models.BackendProperties + :paramtype properties: ~azure.mgmt.apimanagement.models.BackendProperties :keyword credentials: Backend Credentials Contract Properties. - :paramtype credentials: ~api_management_client.models.BackendCredentialsContract + :paramtype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :keyword proxy: Backend Proxy Contract Properties. - :paramtype proxy: ~api_management_client.models.BackendProxyContract + :paramtype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :keyword tls: Backend TLS Properties. - :paramtype tls: ~api_management_client.models.BackendTlsProperties + :paramtype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :keyword url: Required. Runtime Url of the Backend. :paramtype url: str :keyword protocol: Required. Backend communication protocol. Possible values include: "http", "soap". - :paramtype protocol: str or ~api_management_client.models.BackendProtocol + :paramtype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ super(BackendContractProperties, self).__init__(title=title, description=description, resource_id=resource_id, properties=properties, credentials=credentials, proxy=proxy, tls=tls, **kwargs) self.url = url @@ -6544,7 +6571,7 @@ class BackendCredentialsContract(msrest.serialization.Model): :ivar header: Header Parameter description. :vartype header: dict[str, list[str]] :ivar authorization: Authorization header authentication. - :vartype authorization: ~api_management_client.models.BackendAuthorizationHeaderCredentials + :vartype authorization: ~azure.mgmt.apimanagement.models.BackendAuthorizationHeaderCredentials """ _validation = { @@ -6581,7 +6608,8 @@ def __init__( :keyword header: Header Parameter description. :paramtype header: dict[str, list[str]] :keyword authorization: Authorization header authentication. - :paramtype authorization: ~api_management_client.models.BackendAuthorizationHeaderCredentials + :paramtype authorization: + ~azure.mgmt.apimanagement.models.BackendAuthorizationHeaderCredentials """ super(BackendCredentialsContract, self).__init__(**kwargs) self.certificate_ids = certificate_ids @@ -6596,7 +6624,7 @@ class BackendProperties(msrest.serialization.Model): :ivar service_fabric_cluster: Backend Service Fabric Cluster Properties. :vartype service_fabric_cluster: - ~api_management_client.models.BackendServiceFabricClusterProperties + ~azure.mgmt.apimanagement.models.BackendServiceFabricClusterProperties """ _attribute_map = { @@ -6612,7 +6640,7 @@ def __init__( """ :keyword service_fabric_cluster: Backend Service Fabric Cluster Properties. :paramtype service_fabric_cluster: - ~api_management_client.models.BackendServiceFabricClusterProperties + ~azure.mgmt.apimanagement.models.BackendServiceFabricClusterProperties """ super(BackendProperties, self).__init__(**kwargs) self.service_fabric_cluster = service_fabric_cluster @@ -6730,7 +6758,7 @@ class BackendServiceFabricClusterProperties(msrest.serialization.Model): uses for tls communication. :vartype server_certificate_thumbprints: list[str] :ivar server_x509_names: Server X509 Certificate Names Collection. - :vartype server_x509_names: list[~api_management_client.models.X509CertificateName] + :vartype server_x509_names: list[~azure.mgmt.apimanagement.models.X509CertificateName] """ _validation = { @@ -6772,7 +6800,7 @@ def __init__( uses for tls communication. :paramtype server_certificate_thumbprints: list[str] :keyword server_x509_names: Server X509 Certificate Names Collection. - :paramtype server_x509_names: list[~api_management_client.models.X509CertificateName] + :paramtype server_x509_names: list[~azure.mgmt.apimanagement.models.X509CertificateName] """ super(BackendServiceFabricClusterProperties, self).__init__(**kwargs) self.client_certificate_id = client_certificate_id @@ -6830,17 +6858,17 @@ class BackendUpdateParameterProperties(BackendBaseParameters): Resource Id of Logic Apps, Function Apps or API Apps. :vartype resource_id: str :ivar properties: Backend Properties contract. - :vartype properties: ~api_management_client.models.BackendProperties + :vartype properties: ~azure.mgmt.apimanagement.models.BackendProperties :ivar credentials: Backend Credentials Contract Properties. - :vartype credentials: ~api_management_client.models.BackendCredentialsContract + :vartype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :ivar proxy: Backend Proxy Contract Properties. - :vartype proxy: ~api_management_client.models.BackendProxyContract + :vartype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :ivar tls: Backend TLS Properties. - :vartype tls: ~api_management_client.models.BackendTlsProperties + :vartype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :ivar url: Runtime Url of the Backend. :vartype url: str :ivar protocol: Backend communication protocol. Possible values include: "http", "soap". - :vartype protocol: str or ~api_management_client.models.BackendProtocol + :vartype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ _validation = { @@ -6885,17 +6913,17 @@ def __init__( Arm Resource Id of Logic Apps, Function Apps or API Apps. :paramtype resource_id: str :keyword properties: Backend Properties contract. - :paramtype properties: ~api_management_client.models.BackendProperties + :paramtype properties: ~azure.mgmt.apimanagement.models.BackendProperties :keyword credentials: Backend Credentials Contract Properties. - :paramtype credentials: ~api_management_client.models.BackendCredentialsContract + :paramtype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :keyword proxy: Backend Proxy Contract Properties. - :paramtype proxy: ~api_management_client.models.BackendProxyContract + :paramtype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :keyword tls: Backend TLS Properties. - :paramtype tls: ~api_management_client.models.BackendTlsProperties + :paramtype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :keyword url: Runtime Url of the Backend. :paramtype url: str :keyword protocol: Backend communication protocol. Possible values include: "http", "soap". - :paramtype protocol: str or ~api_management_client.models.BackendProtocol + :paramtype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ super(BackendUpdateParameterProperties, self).__init__(title=title, description=description, resource_id=resource_id, properties=properties, credentials=credentials, proxy=proxy, tls=tls, **kwargs) self.url = url @@ -6913,17 +6941,17 @@ class BackendUpdateParameters(msrest.serialization.Model): Resource Id of Logic Apps, Function Apps or API Apps. :vartype resource_id: str :ivar properties: Backend Properties contract. - :vartype properties: ~api_management_client.models.BackendProperties + :vartype properties: ~azure.mgmt.apimanagement.models.BackendProperties :ivar credentials: Backend Credentials Contract Properties. - :vartype credentials: ~api_management_client.models.BackendCredentialsContract + :vartype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :ivar proxy: Backend Proxy Contract Properties. - :vartype proxy: ~api_management_client.models.BackendProxyContract + :vartype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :ivar tls: Backend TLS Properties. - :vartype tls: ~api_management_client.models.BackendTlsProperties + :vartype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :ivar url: Runtime Url of the Backend. :vartype url: str :ivar protocol: Backend communication protocol. Possible values include: "http", "soap". - :vartype protocol: str or ~api_management_client.models.BackendProtocol + :vartype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ _validation = { @@ -6968,17 +6996,17 @@ def __init__( Arm Resource Id of Logic Apps, Function Apps or API Apps. :paramtype resource_id: str :keyword properties: Backend Properties contract. - :paramtype properties: ~api_management_client.models.BackendProperties + :paramtype properties: ~azure.mgmt.apimanagement.models.BackendProperties :keyword credentials: Backend Credentials Contract Properties. - :paramtype credentials: ~api_management_client.models.BackendCredentialsContract + :paramtype credentials: ~azure.mgmt.apimanagement.models.BackendCredentialsContract :keyword proxy: Backend Proxy Contract Properties. - :paramtype proxy: ~api_management_client.models.BackendProxyContract + :paramtype proxy: ~azure.mgmt.apimanagement.models.BackendProxyContract :keyword tls: Backend TLS Properties. - :paramtype tls: ~api_management_client.models.BackendTlsProperties + :paramtype tls: ~azure.mgmt.apimanagement.models.BackendTlsProperties :keyword url: Runtime Url of the Backend. :paramtype url: str :keyword protocol: Backend communication protocol. Possible values include: "http", "soap". - :paramtype protocol: str or ~api_management_client.models.BackendProtocol + :paramtype protocol: str or ~azure.mgmt.apimanagement.models.BackendProtocol """ super(BackendUpdateParameters, self).__init__(**kwargs) self.title = title @@ -7025,7 +7053,7 @@ class CacheCollection(msrest.serialization.Model): """Paged Caches list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.CacheContract] + :vartype value: list[~azure.mgmt.apimanagement.models.CacheContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -7048,7 +7076,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.CacheContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.CacheContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -7190,7 +7218,7 @@ class CertificateCollection(msrest.serialization.Model): """Paged Certificates list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.CertificateContract] + :vartype value: list[~azure.mgmt.apimanagement.models.CertificateContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -7213,7 +7241,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.CertificateContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.CertificateContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -7237,9 +7265,9 @@ class CertificateConfiguration(msrest.serialization.Model): :ivar store_name: Required. The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: "CertificateAuthority", "Root". - :vartype store_name: str or ~api_management_client.models.CertificateConfigurationStoreName + :vartype store_name: str or ~azure.mgmt.apimanagement.models.CertificateConfigurationStoreName :ivar certificate: Certificate information. - :vartype certificate: ~api_management_client.models.CertificateInformation + :vartype certificate: ~azure.mgmt.apimanagement.models.CertificateInformation """ _validation = { @@ -7270,9 +7298,10 @@ def __init__( :keyword store_name: Required. The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: "CertificateAuthority", "Root". - :paramtype store_name: str or ~api_management_client.models.CertificateConfigurationStoreName + :paramtype store_name: str or + ~azure.mgmt.apimanagement.models.CertificateConfigurationStoreName :keyword certificate: Certificate information. - :paramtype certificate: ~api_management_client.models.CertificateInformation + :paramtype certificate: ~azure.mgmt.apimanagement.models.CertificateInformation """ super(CertificateConfiguration, self).__init__(**kwargs) self.encoded_certificate = encoded_certificate @@ -7302,7 +7331,7 @@ class CertificateContract(Resource): format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :vartype expiration_date: ~datetime.datetime :ivar key_vault: KeyVault location details of the certificate. - :vartype key_vault: ~api_management_client.models.KeyVaultContractProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ _validation = { @@ -7339,7 +7368,7 @@ def __init__( following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :paramtype expiration_date: ~datetime.datetime :keyword key_vault: KeyVault location details of the certificate. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ super(CertificateContract, self).__init__(**kwargs) self.subject = subject @@ -7356,7 +7385,7 @@ class CertificateCreateOrUpdateParameters(msrest.serialization.Model): :ivar password: Password for the Certificate. :vartype password: str :ivar key_vault: KeyVault location details of the certificate. - :vartype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _attribute_map = { @@ -7379,7 +7408,7 @@ def __init__( :keyword password: Password for the Certificate. :paramtype password: str :keyword key_vault: KeyVault location details of the certificate. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ super(CertificateCreateOrUpdateParameters, self).__init__(**kwargs) self.data = data @@ -7467,19 +7496,19 @@ class ConnectivityCheckRequest(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar source: Required. Definitions about the connectivity check origin. - :vartype source: ~api_management_client.models.ConnectivityCheckRequestSource + :vartype source: ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestSource :ivar destination: Required. The connectivity check operation destination. - :vartype destination: ~api_management_client.models.ConnectivityCheckRequestDestination + :vartype destination: ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestDestination :ivar preferred_ip_version: The IP version to be used. Only IPv4 is supported for now. Possible values include: "IPv4". - :vartype preferred_ip_version: str or ~api_management_client.models.PreferredIPVersion + :vartype preferred_ip_version: str or ~azure.mgmt.apimanagement.models.PreferredIPVersion :ivar protocol: The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination address must be coherent with this value. Possible values include: "TCP", "HTTP", "HTTPS". - :vartype protocol: str or ~api_management_client.models.ConnectivityCheckProtocol + :vartype protocol: str or ~azure.mgmt.apimanagement.models.ConnectivityCheckProtocol :ivar protocol_configuration: Protocol-specific configuration. :vartype protocol_configuration: - ~api_management_client.models.ConnectivityCheckRequestProtocolConfiguration + ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestProtocolConfiguration """ _validation = { @@ -7507,19 +7536,19 @@ def __init__( ): """ :keyword source: Required. Definitions about the connectivity check origin. - :paramtype source: ~api_management_client.models.ConnectivityCheckRequestSource + :paramtype source: ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestSource :keyword destination: Required. The connectivity check operation destination. - :paramtype destination: ~api_management_client.models.ConnectivityCheckRequestDestination + :paramtype destination: ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestDestination :keyword preferred_ip_version: The IP version to be used. Only IPv4 is supported for now. Possible values include: "IPv4". - :paramtype preferred_ip_version: str or ~api_management_client.models.PreferredIPVersion + :paramtype preferred_ip_version: str or ~azure.mgmt.apimanagement.models.PreferredIPVersion :keyword protocol: The request's protocol. Specific protocol configuration can be available based on this selection. The specified destination address must be coherent with this value. Possible values include: "TCP", "HTTP", "HTTPS". - :paramtype protocol: str or ~api_management_client.models.ConnectivityCheckProtocol + :paramtype protocol: str or ~azure.mgmt.apimanagement.models.ConnectivityCheckProtocol :keyword protocol_configuration: Protocol-specific configuration. :paramtype protocol_configuration: - ~api_management_client.models.ConnectivityCheckRequestProtocolConfiguration + ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestProtocolConfiguration """ super(ConnectivityCheckRequest, self).__init__(**kwargs) self.source = source @@ -7573,7 +7602,7 @@ class ConnectivityCheckRequestProtocolConfiguration(msrest.serialization.Model): :ivar http_configuration: Configuration for HTTP or HTTPS requests. :vartype http_configuration: - ~api_management_client.models.ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration + ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration """ _attribute_map = { @@ -7589,7 +7618,7 @@ def __init__( """ :keyword http_configuration: Configuration for HTTP or HTTPS requests. :paramtype http_configuration: - ~api_management_client.models.ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration + ~azure.mgmt.apimanagement.models.ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration """ super(ConnectivityCheckRequestProtocolConfiguration, self).__init__(**kwargs) self.http_configuration = http_configuration @@ -7599,11 +7628,11 @@ class ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration(msrest.seri """Configuration for HTTP or HTTPS requests. :ivar method: The HTTP method to be used. Possible values include: "GET", "POST". - :vartype method: str or ~api_management_client.models.Method + :vartype method: str or ~azure.mgmt.apimanagement.models.Method :ivar valid_status_codes: List of HTTP status codes considered valid for the request response. :vartype valid_status_codes: list[long] :ivar headers: List of headers to be included in the request. - :vartype headers: list[~api_management_client.models.HTTPHeader] + :vartype headers: list[~azure.mgmt.apimanagement.models.HTTPHeader] """ _attribute_map = { @@ -7622,12 +7651,12 @@ def __init__( ): """ :keyword method: The HTTP method to be used. Possible values include: "GET", "POST". - :paramtype method: str or ~api_management_client.models.Method + :paramtype method: str or ~azure.mgmt.apimanagement.models.Method :keyword valid_status_codes: List of HTTP status codes considered valid for the request response. :paramtype valid_status_codes: list[long] :keyword headers: List of headers to be included in the request. - :paramtype headers: list[~api_management_client.models.HTTPHeader] + :paramtype headers: list[~azure.mgmt.apimanagement.models.HTTPHeader] """ super(ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration, self).__init__(**kwargs) self.method = method @@ -7681,10 +7710,10 @@ class ConnectivityCheckResponse(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar hops: List of hops between the source and the destination. - :vartype hops: list[~api_management_client.models.ConnectivityHop] + :vartype hops: list[~azure.mgmt.apimanagement.models.ConnectivityHop] :ivar connection_status: The connection status. Possible values include: "Unknown", "Connected", "Disconnected", "Degraded". - :vartype connection_status: str or ~api_management_client.models.ConnectionStatus + :vartype connection_status: str or ~azure.mgmt.apimanagement.models.ConnectionStatus :ivar avg_latency_in_ms: Average latency in milliseconds. :vartype avg_latency_in_ms: long :ivar min_latency_in_ms: Minimum latency in milliseconds. @@ -7749,7 +7778,7 @@ class ConnectivityHop(msrest.serialization.Model): :ivar next_hop_ids: List of next hop identifiers. :vartype next_hop_ids: list[str] :ivar issues: List of issues. - :vartype issues: list[~api_management_client.models.ConnectivityIssue] + :vartype issues: list[~azure.mgmt.apimanagement.models.ConnectivityIssue] """ _validation = { @@ -7791,13 +7820,13 @@ class ConnectivityIssue(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar origin: The origin of the issue. Possible values include: "Local", "Inbound", "Outbound". - :vartype origin: str or ~api_management_client.models.Origin + :vartype origin: str or ~azure.mgmt.apimanagement.models.Origin :ivar severity: The severity of the issue. Possible values include: "Error", "Warning". - :vartype severity: str or ~api_management_client.models.Severity + :vartype severity: str or ~azure.mgmt.apimanagement.models.Severity :ivar type: The type of issue. Possible values include: "Unknown", "AgentStopped", "GuestFirewall", "DnsResolution", "SocketBind", "NetworkSecurityRule", "UserDefinedRoute", "PortThrottled", "Platform". - :vartype type: str or ~api_management_client.models.IssueType + :vartype type: str or ~azure.mgmt.apimanagement.models.IssueType :ivar context: Provides additional context on the issue. :vartype context: list[dict[str, str]] """ @@ -7839,7 +7868,7 @@ class ConnectivityStatusContract(msrest.serialization.Model): :vartype name: str :ivar status: Required. Resource Connectivity Status Type identifier. Possible values include: "initializing", "success", "failure". - :vartype status: str or ~api_management_client.models.ConnectivityStatusType + :vartype status: str or ~azure.mgmt.apimanagement.models.ConnectivityStatusType :ivar error: Error details of the connectivity to the resource. :vartype error: str :ivar last_updated: Required. The date when the resource connectivity status was last updated. @@ -7895,7 +7924,7 @@ def __init__( :paramtype name: str :keyword status: Required. Resource Connectivity Status Type identifier. Possible values include: "initializing", "success", "failure". - :paramtype status: str or ~api_management_client.models.ConnectivityStatusType + :paramtype status: str or ~azure.mgmt.apimanagement.models.ConnectivityStatusType :keyword error: Error details of the connectivity to the resource. :paramtype error: str :keyword last_updated: Required. The date when the resource connectivity status was last @@ -7929,7 +7958,7 @@ class ContentItemCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Collection of content items. - :vartype value: list[~api_management_client.models.ContentItemContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ContentItemContract] :ivar next_link: Next page link, if any. :vartype next_link: str """ @@ -8005,7 +8034,7 @@ class ContentTypeCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Collection of content types. - :vartype value: list[~api_management_client.models.ContentTypeContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ContentTypeContract] :ivar next_link: Next page link, if any. :vartype next_link: str """ @@ -8107,9 +8136,9 @@ class DataMasking(msrest.serialization.Model): """DataMasking. :ivar query_params: Masking settings for Url query parameters. - :vartype query_params: list[~api_management_client.models.DataMaskingEntity] + :vartype query_params: list[~azure.mgmt.apimanagement.models.DataMaskingEntity] :ivar headers: Masking settings for headers. - :vartype headers: list[~api_management_client.models.DataMaskingEntity] + :vartype headers: list[~azure.mgmt.apimanagement.models.DataMaskingEntity] """ _attribute_map = { @@ -8126,9 +8155,9 @@ def __init__( ): """ :keyword query_params: Masking settings for Url query parameters. - :paramtype query_params: list[~api_management_client.models.DataMaskingEntity] + :paramtype query_params: list[~azure.mgmt.apimanagement.models.DataMaskingEntity] :keyword headers: Masking settings for headers. - :paramtype headers: list[~api_management_client.models.DataMaskingEntity] + :paramtype headers: list[~azure.mgmt.apimanagement.models.DataMaskingEntity] """ super(DataMasking, self).__init__(**kwargs) self.query_params = query_params @@ -8141,7 +8170,7 @@ class DataMaskingEntity(msrest.serialization.Model): :ivar value: The name of an entity to mask (e.g. a name of a header or a query parameter). :vartype value: str :ivar mode: Data masking mode. Possible values include: "Mask", "Hide". - :vartype mode: str or ~api_management_client.models.DataMaskingMode + :vartype mode: str or ~azure.mgmt.apimanagement.models.DataMaskingMode """ _attribute_map = { @@ -8160,7 +8189,7 @@ def __init__( :keyword value: The name of an entity to mask (e.g. a name of a header or a query parameter). :paramtype value: str :keyword mode: Data masking mode. Possible values include: "Mask", "Hide". - :paramtype mode: str or ~api_management_client.models.DataMaskingMode + :paramtype mode: str or ~azure.mgmt.apimanagement.models.DataMaskingMode """ super(DataMaskingEntity, self).__init__(**kwargs) self.value = value @@ -8242,7 +8271,7 @@ class DeletedServicesCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.DeletedServiceContract] + :vartype value: list[~azure.mgmt.apimanagement.models.DeletedServiceContract] :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -8308,7 +8337,7 @@ class DiagnosticCollection(msrest.serialization.Model): """Paged Diagnostic list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.DiagnosticContract] + :vartype value: list[~azure.mgmt.apimanagement.models.DiagnosticContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -8331,7 +8360,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.DiagnosticContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.DiagnosticContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -8358,27 +8387,27 @@ class DiagnosticContract(Resource): :vartype type: str :ivar always_log: Specifies for what type of messages sampling settings should not apply. Possible values include: "allErrors". - :vartype always_log: str or ~api_management_client.models.AlwaysLog + :vartype always_log: str or ~azure.mgmt.apimanagement.models.AlwaysLog :ivar logger_id: Resource Id of a target logger. :vartype logger_id: str :ivar sampling: Sampling settings for Diagnostic. - :vartype sampling: ~api_management_client.models.SamplingSettings + :vartype sampling: ~azure.mgmt.apimanagement.models.SamplingSettings :ivar frontend: Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. - :vartype frontend: ~api_management_client.models.PipelineDiagnosticSettings + :vartype frontend: ~azure.mgmt.apimanagement.models.PipelineDiagnosticSettings :ivar backend: Diagnostic settings for incoming/outgoing HTTP messages to the Backend. - :vartype backend: ~api_management_client.models.PipelineDiagnosticSettings + :vartype backend: ~azure.mgmt.apimanagement.models.PipelineDiagnosticSettings :ivar log_client_ip: Log the ClientIP. Default is false. :vartype log_client_ip: bool :ivar http_correlation_protocol: Sets correlation protocol to use for Application Insights diagnostics. Possible values include: "None", "Legacy", "W3C". :vartype http_correlation_protocol: str or - ~api_management_client.models.HttpCorrelationProtocol + ~azure.mgmt.apimanagement.models.HttpCorrelationProtocol :ivar verbosity: The verbosity level applied to traces emitted by trace policies. Possible values include: "verbose", "information", "error". - :vartype verbosity: str or ~api_management_client.models.Verbosity + :vartype verbosity: str or ~azure.mgmt.apimanagement.models.Verbosity :ivar operation_name_format: The format of the Operation Name for Application Insights telemetries. Default is Name. Possible values include: "Name", "Url". - :vartype operation_name_format: str or ~api_management_client.models.OperationNameFormat + :vartype operation_name_format: str or ~azure.mgmt.apimanagement.models.OperationNameFormat """ _validation = { @@ -8419,27 +8448,27 @@ def __init__( """ :keyword always_log: Specifies for what type of messages sampling settings should not apply. Possible values include: "allErrors". - :paramtype always_log: str or ~api_management_client.models.AlwaysLog + :paramtype always_log: str or ~azure.mgmt.apimanagement.models.AlwaysLog :keyword logger_id: Resource Id of a target logger. :paramtype logger_id: str :keyword sampling: Sampling settings for Diagnostic. - :paramtype sampling: ~api_management_client.models.SamplingSettings + :paramtype sampling: ~azure.mgmt.apimanagement.models.SamplingSettings :keyword frontend: Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. - :paramtype frontend: ~api_management_client.models.PipelineDiagnosticSettings + :paramtype frontend: ~azure.mgmt.apimanagement.models.PipelineDiagnosticSettings :keyword backend: Diagnostic settings for incoming/outgoing HTTP messages to the Backend. - :paramtype backend: ~api_management_client.models.PipelineDiagnosticSettings + :paramtype backend: ~azure.mgmt.apimanagement.models.PipelineDiagnosticSettings :keyword log_client_ip: Log the ClientIP. Default is false. :paramtype log_client_ip: bool :keyword http_correlation_protocol: Sets correlation protocol to use for Application Insights diagnostics. Possible values include: "None", "Legacy", "W3C". :paramtype http_correlation_protocol: str or - ~api_management_client.models.HttpCorrelationProtocol + ~azure.mgmt.apimanagement.models.HttpCorrelationProtocol :keyword verbosity: The verbosity level applied to traces emitted by trace policies. Possible values include: "verbose", "information", "error". - :paramtype verbosity: str or ~api_management_client.models.Verbosity + :paramtype verbosity: str or ~azure.mgmt.apimanagement.models.Verbosity :keyword operation_name_format: The format of the Operation Name for Application Insights telemetries. Default is Name. Possible values include: "Name", "Url". - :paramtype operation_name_format: str or ~api_management_client.models.OperationNameFormat + :paramtype operation_name_format: str or ~azure.mgmt.apimanagement.models.OperationNameFormat """ super(DiagnosticContract, self).__init__(**kwargs) self.always_log = always_log @@ -8457,7 +8486,7 @@ class EmailTemplateCollection(msrest.serialization.Model): """Paged email template list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.EmailTemplateContract] + :vartype value: list[~azure.mgmt.apimanagement.models.EmailTemplateContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -8480,7 +8509,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.EmailTemplateContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.EmailTemplateContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -8518,7 +8547,7 @@ class EmailTemplateContract(Resource): :vartype is_default: bool :ivar parameters: Email Template Parameter values. :vartype parameters: - list[~api_management_client.models.EmailTemplateParametersContractProperties] + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] """ _validation = { @@ -8563,7 +8592,7 @@ def __init__( :paramtype description: str :keyword parameters: Email Template Parameter values. :paramtype parameters: - list[~api_management_client.models.EmailTemplateParametersContractProperties] + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] """ super(EmailTemplateContract, self).__init__(**kwargs) self.subject = subject @@ -8632,7 +8661,7 @@ class EmailTemplateUpdateParameters(msrest.serialization.Model): :vartype body: str :ivar parameters: Email Template Parameter values. :vartype parameters: - list[~api_management_client.models.EmailTemplateParametersContractProperties] + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] """ _validation = { @@ -8669,7 +8698,7 @@ def __init__( :paramtype body: str :keyword parameters: Email Template Parameter values. :paramtype parameters: - list[~api_management_client.models.EmailTemplateParametersContractProperties] + list[~azure.mgmt.apimanagement.models.EmailTemplateParametersContractProperties] """ super(EmailTemplateUpdateParameters, self).__init__(**kwargs) self.subject = subject @@ -8685,7 +8714,7 @@ class EndpointDependency(msrest.serialization.Model): :ivar domain_name: The domain name of the dependency. :vartype domain_name: str :ivar endpoint_details: The Ports used when connecting to DomainName. - :vartype endpoint_details: list[~api_management_client.models.EndpointDetail] + :vartype endpoint_details: list[~azure.mgmt.apimanagement.models.EndpointDetail] """ _attribute_map = { @@ -8704,7 +8733,7 @@ def __init__( :keyword domain_name: The domain name of the dependency. :paramtype domain_name: str :keyword endpoint_details: The Ports used when connecting to DomainName. - :paramtype endpoint_details: list[~api_management_client.models.EndpointDetail] + :paramtype endpoint_details: list[~azure.mgmt.apimanagement.models.EndpointDetail] """ super(EndpointDependency, self).__init__(**kwargs) self.domain_name = domain_name @@ -8791,7 +8820,7 @@ class ErrorResponse(msrest.serialization.Model): :ivar message: Human-readable representation of the error. :vartype message: str :ivar details: The list of invalid fields send in request, in case of validation error. - :vartype details: list[~api_management_client.models.ErrorFieldContract] + :vartype details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] """ _attribute_map = { @@ -8815,7 +8844,7 @@ def __init__( :keyword message: Human-readable representation of the error. :paramtype message: str :keyword details: The list of invalid fields send in request, in case of validation error. - :paramtype details: list[~api_management_client.models.ErrorFieldContract] + :paramtype details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] """ super(ErrorResponse, self).__init__(**kwargs) self.code = code @@ -8832,7 +8861,7 @@ class ErrorResponseBody(msrest.serialization.Model): :ivar message: Human-readable representation of the error. :vartype message: str :ivar details: The list of invalid fields send in request, in case of validation error. - :vartype details: list[~api_management_client.models.ErrorFieldContract] + :vartype details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] """ _attribute_map = { @@ -8856,7 +8885,7 @@ def __init__( :keyword message: Human-readable representation of the error. :paramtype message: str :keyword details: The list of invalid fields send in request, in case of validation error. - :paramtype details: list[~api_management_client.models.ErrorFieldContract] + :paramtype details: list[~azure.mgmt.apimanagement.models.ErrorFieldContract] """ super(ErrorResponseBody, self).__init__(**kwargs) self.code = code @@ -8870,7 +8899,7 @@ class GatewayCertificateAuthorityCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.GatewayCertificateAuthorityContract] + :vartype value: list[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract] :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -8946,7 +8975,7 @@ class GatewayCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.GatewayContract] + :vartype value: list[~azure.mgmt.apimanagement.models.GatewayContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -8994,7 +9023,7 @@ class GatewayContract(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar location_data: Gateway location. - :vartype location_data: ~api_management_client.models.ResourceLocationDataContract + :vartype location_data: ~azure.mgmt.apimanagement.models.ResourceLocationDataContract :ivar description: Gateway description. :vartype description: str """ @@ -9023,7 +9052,7 @@ def __init__( ): """ :keyword location_data: Gateway location. - :paramtype location_data: ~api_management_client.models.ResourceLocationDataContract + :paramtype location_data: ~azure.mgmt.apimanagement.models.ResourceLocationDataContract :keyword description: Gateway description. :paramtype description: str """ @@ -9038,7 +9067,7 @@ class GatewayHostnameConfigurationCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.GatewayHostnameConfigurationContract] + :vartype value: list[~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationContract] :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -9152,7 +9181,7 @@ class GatewayKeyRegenerationRequestContract(msrest.serialization.Model): :ivar key_type: Required. The Key being regenerated. Possible values include: "primary", "secondary". - :vartype key_type: str or ~api_management_client.models.KeyType + :vartype key_type: str or ~azure.mgmt.apimanagement.models.KeyType """ _validation = { @@ -9172,7 +9201,7 @@ def __init__( """ :keyword key_type: Required. The Key being regenerated. Possible values include: "primary", "secondary". - :paramtype key_type: str or ~api_management_client.models.KeyType + :paramtype key_type: str or ~azure.mgmt.apimanagement.models.KeyType """ super(GatewayKeyRegenerationRequestContract, self).__init__(**kwargs) self.key_type = key_type @@ -9242,7 +9271,7 @@ class GatewayTokenRequestContract(msrest.serialization.Model): :ivar key_type: Required. The Key to be used to generate gateway token. Possible values include: "primary", "secondary". - :vartype key_type: str or ~api_management_client.models.KeyType + :vartype key_type: str or ~azure.mgmt.apimanagement.models.KeyType :ivar expiry: Required. The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. @@ -9269,7 +9298,7 @@ def __init__( """ :keyword key_type: Required. The Key to be used to generate gateway token. Possible values include: "primary", "secondary". - :paramtype key_type: str or ~api_management_client.models.KeyType + :paramtype key_type: str or ~azure.mgmt.apimanagement.models.KeyType :keyword expiry: Required. The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. @@ -9311,7 +9340,7 @@ class GlobalSchemaCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Global Schema Contract value. - :vartype value: list[~api_management_client.models.GlobalSchemaContract] + :vartype value: list[~azure.mgmt.apimanagement.models.GlobalSchemaContract] :ivar count: Total record count number. :vartype count: long :ivar next_link: Next page link if any. @@ -9359,7 +9388,7 @@ class GlobalSchemaContract(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar schema_type: Schema Type. Immutable. Possible values include: "xml", "json". - :vartype schema_type: str or ~api_management_client.models.SchemaType + :vartype schema_type: str or ~azure.mgmt.apimanagement.models.SchemaType :ivar description: Free-form schema entity description. :vartype description: str :ivar value: Json-encoded string for non json-based schema. @@ -9395,7 +9424,7 @@ def __init__( ): """ :keyword schema_type: Schema Type. Immutable. Possible values include: "xml", "json". - :paramtype schema_type: str or ~api_management_client.models.SchemaType + :paramtype schema_type: str or ~azure.mgmt.apimanagement.models.SchemaType :keyword description: Free-form schema entity description. :paramtype description: str :keyword value: Json-encoded string for non json-based schema. @@ -9415,7 +9444,7 @@ class GroupCollection(msrest.serialization.Model): """Paged Group list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.GroupContract] + :vartype value: list[~azure.mgmt.apimanagement.models.GroupContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -9438,7 +9467,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.GroupContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.GroupContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -9472,7 +9501,7 @@ class GroupContract(Resource): :vartype built_in: bool :ivar type_properties_type: Group type. Possible values include: "custom", "system", "external". - :vartype type_properties_type: str or ~api_management_client.models.GroupType + :vartype type_properties_type: str or ~azure.mgmt.apimanagement.models.GroupType :ivar external_id: For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9515,7 +9544,7 @@ def __init__( :paramtype description: str :keyword type_properties_type: Group type. Possible values include: "custom", "system", "external". - :paramtype type_properties_type: str or ~api_management_client.models.GroupType + :paramtype type_properties_type: str or ~azure.mgmt.apimanagement.models.GroupType :keyword external_id: For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9544,7 +9573,7 @@ class GroupContractProperties(msrest.serialization.Model): Developers, or Guests); otherwise false. :vartype built_in: bool :ivar type: Group type. Possible values include: "custom", "system", "external". - :vartype type: str or ~api_management_client.models.GroupType + :vartype type: str or ~azure.mgmt.apimanagement.models.GroupType :ivar external_id: For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9580,7 +9609,7 @@ def __init__( :keyword description: Group description. Can contain HTML formatting tags. :paramtype description: str :keyword type: Group type. Possible values include: "custom", "system", "external". - :paramtype type: str or ~api_management_client.models.GroupType + :paramtype type: str or ~azure.mgmt.apimanagement.models.GroupType :keyword external_id: For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9602,7 +9631,7 @@ class GroupCreateParameters(msrest.serialization.Model): :ivar description: Group description. :vartype description: str :ivar type: Group type. Possible values include: "custom", "system", "external". - :vartype type: str or ~api_management_client.models.GroupType + :vartype type: str or ~azure.mgmt.apimanagement.models.GroupType :ivar external_id: Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9635,7 +9664,7 @@ def __init__( :keyword description: Group description. :paramtype description: str :keyword type: Group type. Possible values include: "custom", "system", "external". - :paramtype type: str or ~api_management_client.models.GroupType + :paramtype type: str or ~azure.mgmt.apimanagement.models.GroupType :keyword external_id: Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9656,7 +9685,7 @@ class GroupUpdateParameters(msrest.serialization.Model): :ivar description: Group description. :vartype description: str :ivar type: Group type. Possible values include: "custom", "system", "external". - :vartype type: str or ~api_management_client.models.GroupType + :vartype type: str or ~azure.mgmt.apimanagement.models.GroupType :ivar external_id: Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9689,7 +9718,7 @@ def __init__( :keyword description: Group description. :paramtype description: str :keyword type: Group type. Possible values include: "custom", "system", "external". - :paramtype type: str or ~api_management_client.models.GroupType + :paramtype type: str or ~azure.mgmt.apimanagement.models.GroupType :keyword external_id: Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory ``aad://.onmicrosoft.com/groups/``\ ; otherwise the value is null. @@ -9709,7 +9738,7 @@ class HostnameConfiguration(msrest.serialization.Model): :ivar type: Required. Hostname type. Possible values include: "Proxy", "Portal", "Management", "Scm", "DeveloperPortal". - :vartype type: str or ~api_management_client.models.HostnameType + :vartype type: str or ~azure.mgmt.apimanagement.models.HostnameType :ivar host_name: Required. Hostname to configure on the Api Management service. :vartype host_name: str :ivar key_vault_id: Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url @@ -9734,13 +9763,13 @@ class HostnameConfiguration(msrest.serialization.Model): hostname. Default Value is false. :vartype negotiate_client_certificate: bool :ivar certificate: Certificate information. - :vartype certificate: ~api_management_client.models.CertificateInformation + :vartype certificate: ~azure.mgmt.apimanagement.models.CertificateInformation :ivar certificate_source: Certificate Source. Possible values include: "Managed", "KeyVault", "Custom", "BuiltIn". - :vartype certificate_source: str or ~api_management_client.models.CertificateSource + :vartype certificate_source: str or ~azure.mgmt.apimanagement.models.CertificateSource :ivar certificate_status: Certificate Status. Possible values include: "Completed", "Failed", "InProgress". - :vartype certificate_status: str or ~api_management_client.models.CertificateStatus + :vartype certificate_status: str or ~azure.mgmt.apimanagement.models.CertificateStatus """ _validation = { @@ -9781,7 +9810,7 @@ def __init__( """ :keyword type: Required. Hostname type. Possible values include: "Proxy", "Portal", "Management", "Scm", "DeveloperPortal". - :paramtype type: str or ~api_management_client.models.HostnameType + :paramtype type: str or ~azure.mgmt.apimanagement.models.HostnameType :keyword host_name: Required. Hostname to configure on the Api Management service. :paramtype host_name: str :keyword key_vault_id: Url to the KeyVault Secret containing the Ssl Certificate. If absolute @@ -9806,13 +9835,13 @@ def __init__( the hostname. Default Value is false. :paramtype negotiate_client_certificate: bool :keyword certificate: Certificate information. - :paramtype certificate: ~api_management_client.models.CertificateInformation + :paramtype certificate: ~azure.mgmt.apimanagement.models.CertificateInformation :keyword certificate_source: Certificate Source. Possible values include: "Managed", "KeyVault", "Custom", "BuiltIn". - :paramtype certificate_source: str or ~api_management_client.models.CertificateSource + :paramtype certificate_source: str or ~azure.mgmt.apimanagement.models.CertificateSource :keyword certificate_status: Certificate Status. Possible values include: "Completed", "Failed", "InProgress". - :paramtype certificate_status: str or ~api_management_client.models.CertificateStatus + :paramtype certificate_status: str or ~azure.mgmt.apimanagement.models.CertificateStatus """ super(HostnameConfiguration, self).__init__(**kwargs) self.type = type @@ -9873,9 +9902,9 @@ class HttpMessageDiagnostic(msrest.serialization.Model): :ivar headers: Array of HTTP Headers to log. :vartype headers: list[str] :ivar body: Body logging settings. - :vartype body: ~api_management_client.models.BodyDiagnosticSettings + :vartype body: ~azure.mgmt.apimanagement.models.BodyDiagnosticSettings :ivar data_masking: Data masking settings. - :vartype data_masking: ~api_management_client.models.DataMasking + :vartype data_masking: ~azure.mgmt.apimanagement.models.DataMasking """ _attribute_map = { @@ -9896,9 +9925,9 @@ def __init__( :keyword headers: Array of HTTP Headers to log. :paramtype headers: list[str] :keyword body: Body logging settings. - :paramtype body: ~api_management_client.models.BodyDiagnosticSettings + :paramtype body: ~azure.mgmt.apimanagement.models.BodyDiagnosticSettings :keyword data_masking: Data masking settings. - :paramtype data_masking: ~api_management_client.models.DataMasking + :paramtype data_masking: ~azure.mgmt.apimanagement.models.DataMasking """ super(HttpMessageDiagnostic, self).__init__(**kwargs) self.headers = headers @@ -9911,7 +9940,7 @@ class IdentityProviderBaseParameters(msrest.serialization.Model): :ivar type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :vartype type: str or ~api_management_client.models.IdentityProviderType + :vartype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :ivar signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :vartype signin_tenant: str :ivar allowed_tenants: List of Allowed Tenants when configuring Azure Active Directory login. @@ -9965,7 +9994,7 @@ def __init__( """ :keyword type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :paramtype type: str or ~api_management_client.models.IdentityProviderType + :paramtype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :paramtype signin_tenant: str @@ -10011,7 +10040,7 @@ class IdentityProviderContract(Resource): :vartype type: str :ivar type_properties_type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :vartype type_properties_type: str or ~api_management_client.models.IdentityProviderType + :vartype type_properties_type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :ivar signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :vartype signin_tenant: str :ivar allowed_tenants: List of Allowed Tenants when configuring Azure Active Directory login. @@ -10085,7 +10114,7 @@ def __init__( """ :keyword type_properties_type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :paramtype type_properties_type: str or ~api_management_client.models.IdentityProviderType + :paramtype type_properties_type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :paramtype signin_tenant: str @@ -10133,7 +10162,7 @@ class IdentityProviderContractProperties(IdentityProviderBaseParameters): :ivar type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :vartype type: str or ~api_management_client.models.IdentityProviderType + :vartype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :ivar signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :vartype signin_tenant: str :ivar allowed_tenants: List of Allowed Tenants when configuring Azure Active Directory login. @@ -10201,7 +10230,7 @@ def __init__( """ :keyword type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :paramtype type: str or ~api_management_client.models.IdentityProviderType + :paramtype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :paramtype signin_tenant: str @@ -10249,7 +10278,7 @@ class IdentityProviderCreateContract(Resource): :vartype type: str :ivar type_properties_type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :vartype type_properties_type: str or ~api_management_client.models.IdentityProviderType + :vartype type_properties_type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :ivar signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :vartype signin_tenant: str :ivar allowed_tenants: List of Allowed Tenants when configuring Azure Active Directory login. @@ -10323,7 +10352,7 @@ def __init__( """ :keyword type_properties_type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :paramtype type_properties_type: str or ~api_management_client.models.IdentityProviderType + :paramtype type_properties_type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :paramtype signin_tenant: str @@ -10371,7 +10400,7 @@ class IdentityProviderCreateContractProperties(IdentityProviderBaseParameters): :ivar type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :vartype type: str or ~api_management_client.models.IdentityProviderType + :vartype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :ivar signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :vartype signin_tenant: str :ivar allowed_tenants: List of Allowed Tenants when configuring Azure Active Directory login. @@ -10439,7 +10468,7 @@ def __init__( """ :keyword type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :paramtype type: str or ~api_management_client.models.IdentityProviderType + :paramtype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :paramtype signin_tenant: str @@ -10476,7 +10505,7 @@ class IdentityProviderList(msrest.serialization.Model): """List of all the Identity Providers configured on the service instance. :ivar value: Identity Provider configuration values. - :vartype value: list[~api_management_client.models.IdentityProviderContract] + :vartype value: list[~azure.mgmt.apimanagement.models.IdentityProviderContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -10499,7 +10528,7 @@ def __init__( ): """ :keyword value: Identity Provider configuration values. - :paramtype value: list[~api_management_client.models.IdentityProviderContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.IdentityProviderContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -10516,7 +10545,7 @@ class IdentityProviderUpdateParameters(msrest.serialization.Model): :ivar type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :vartype type: str or ~api_management_client.models.IdentityProviderType + :vartype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :ivar signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :vartype signin_tenant: str :ivar allowed_tenants: List of Allowed Tenants when configuring Azure Active Directory login. @@ -10583,7 +10612,7 @@ def __init__( """ :keyword type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :paramtype type: str or ~api_management_client.models.IdentityProviderType + :paramtype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :paramtype signin_tenant: str @@ -10628,7 +10657,7 @@ class IdentityProviderUpdateProperties(IdentityProviderBaseParameters): :ivar type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :vartype type: str or ~api_management_client.models.IdentityProviderType + :vartype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :ivar signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :vartype signin_tenant: str :ivar allowed_tenants: List of Allowed Tenants when configuring Azure Active Directory login. @@ -10695,7 +10724,7 @@ def __init__( """ :keyword type: Identity Provider Type identifier. Possible values include: "facebook", "google", "microsoft", "twitter", "aad", "aadB2C". - :paramtype type: str or ~api_management_client.models.IdentityProviderType + :paramtype type: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword signin_tenant: The TenantId to use instead of Common when logging into Active Directory. :paramtype signin_tenant: str @@ -10733,7 +10762,7 @@ class IssueAttachmentCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Issue Attachment values. - :vartype value: list[~api_management_client.models.IssueAttachmentContract] + :vartype value: list[~azure.mgmt.apimanagement.models.IssueAttachmentContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -10833,7 +10862,7 @@ class IssueCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Issue values. - :vartype value: list[~api_management_client.models.IssueContract] + :vartype value: list[~azure.mgmt.apimanagement.models.IssueContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -10873,7 +10902,7 @@ class IssueCommentCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Issue Comment values. - :vartype value: list[~api_management_client.models.IssueCommentContract] + :vartype value: list[~azure.mgmt.apimanagement.models.IssueCommentContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -10982,7 +11011,7 @@ class IssueContract(Resource): :vartype created_date: ~datetime.datetime :ivar state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :vartype state: str or ~api_management_client.models.State + :vartype state: str or ~azure.mgmt.apimanagement.models.State :ivar api_id: A resource identifier for the API the issue was created for. :vartype api_id: str :ivar title: The issue title. @@ -11027,7 +11056,7 @@ def __init__( :paramtype created_date: ~datetime.datetime :keyword state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :paramtype state: str or ~api_management_client.models.State + :paramtype state: str or ~azure.mgmt.apimanagement.models.State :keyword api_id: A resource identifier for the API the issue was created for. :paramtype api_id: str :keyword title: The issue title. @@ -11053,7 +11082,7 @@ class IssueContractBaseProperties(msrest.serialization.Model): :vartype created_date: ~datetime.datetime :ivar state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :vartype state: str or ~api_management_client.models.State + :vartype state: str or ~azure.mgmt.apimanagement.models.State :ivar api_id: A resource identifier for the API the issue was created for. :vartype api_id: str """ @@ -11077,7 +11106,7 @@ def __init__( :paramtype created_date: ~datetime.datetime :keyword state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :paramtype state: str or ~api_management_client.models.State + :paramtype state: str or ~azure.mgmt.apimanagement.models.State :keyword api_id: A resource identifier for the API the issue was created for. :paramtype api_id: str """ @@ -11096,7 +11125,7 @@ class IssueContractProperties(IssueContractBaseProperties): :vartype created_date: ~datetime.datetime :ivar state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :vartype state: str or ~api_management_client.models.State + :vartype state: str or ~azure.mgmt.apimanagement.models.State :ivar api_id: A resource identifier for the API the issue was created for. :vartype api_id: str :ivar title: Required. The issue title. @@ -11138,7 +11167,7 @@ def __init__( :paramtype created_date: ~datetime.datetime :keyword state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :paramtype state: str or ~api_management_client.models.State + :paramtype state: str or ~azure.mgmt.apimanagement.models.State :keyword api_id: A resource identifier for the API the issue was created for. :paramtype api_id: str :keyword title: Required. The issue title. @@ -11161,7 +11190,7 @@ class IssueUpdateContract(msrest.serialization.Model): :vartype created_date: ~datetime.datetime :ivar state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :vartype state: str or ~api_management_client.models.State + :vartype state: str or ~azure.mgmt.apimanagement.models.State :ivar api_id: A resource identifier for the API the issue was created for. :vartype api_id: str :ivar title: The issue title. @@ -11197,7 +11226,7 @@ def __init__( :paramtype created_date: ~datetime.datetime :keyword state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :paramtype state: str or ~api_management_client.models.State + :paramtype state: str or ~azure.mgmt.apimanagement.models.State :keyword api_id: A resource identifier for the API the issue was created for. :paramtype api_id: str :keyword title: The issue title. @@ -11223,7 +11252,7 @@ class IssueUpdateContractProperties(IssueContractBaseProperties): :vartype created_date: ~datetime.datetime :ivar state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :vartype state: str or ~api_management_client.models.State + :vartype state: str or ~azure.mgmt.apimanagement.models.State :ivar api_id: A resource identifier for the API the issue was created for. :vartype api_id: str :ivar title: The issue title. @@ -11259,7 +11288,7 @@ def __init__( :paramtype created_date: ~datetime.datetime :keyword state: Status of the issue. Possible values include: "proposed", "open", "removed", "resolved", "closed". - :paramtype state: str or ~api_management_client.models.State + :paramtype state: str or ~azure.mgmt.apimanagement.models.State :keyword api_id: A resource identifier for the API the issue was created for. :paramtype api_id: str :keyword title: The issue title. @@ -11282,8 +11311,8 @@ class KeyVaultContractCreateProperties(msrest.serialization.Model): secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi. :vartype secret_identifier: str - :ivar identity_client_id: SystemAssignedIdentity or UserAssignedIdentity Client Id which will - be used to access key vault secret. + :ivar identity_client_id: Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity + , which will be used to access key vault secret. :vartype identity_client_id: str """ @@ -11304,8 +11333,8 @@ def __init__( versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi. :paramtype secret_identifier: str - :keyword identity_client_id: SystemAssignedIdentity or UserAssignedIdentity Client Id which - will be used to access key vault secret. + :keyword identity_client_id: Null for SystemAssignedIdentity or Client Id for + UserAssignedIdentity , which will be used to access key vault secret. :paramtype identity_client_id: str """ super(KeyVaultContractCreateProperties, self).__init__(**kwargs) @@ -11320,11 +11349,12 @@ class KeyVaultContractProperties(KeyVaultContractCreateProperties): secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi. :vartype secret_identifier: str - :ivar identity_client_id: SystemAssignedIdentity or UserAssignedIdentity Client Id which will - be used to access key vault secret. + :ivar identity_client_id: Null for SystemAssignedIdentity or Client Id for UserAssignedIdentity + , which will be used to access key vault secret. :vartype identity_client_id: str :ivar last_status: Last time sync and refresh status of secret from key vault. - :vartype last_status: ~api_management_client.models.KeyVaultLastAccessStatusContractProperties + :vartype last_status: + ~azure.mgmt.apimanagement.models.KeyVaultLastAccessStatusContractProperties """ _attribute_map = { @@ -11346,12 +11376,12 @@ def __init__( versioned secret will prevent auto-refresh. This requires API Management service to be configured with aka.ms/apimmsi. :paramtype secret_identifier: str - :keyword identity_client_id: SystemAssignedIdentity or UserAssignedIdentity Client Id which - will be used to access key vault secret. + :keyword identity_client_id: Null for SystemAssignedIdentity or Client Id for + UserAssignedIdentity , which will be used to access key vault secret. :paramtype identity_client_id: str :keyword last_status: Last time sync and refresh status of secret from key vault. :paramtype last_status: - ~api_management_client.models.KeyVaultLastAccessStatusContractProperties + ~azure.mgmt.apimanagement.models.KeyVaultLastAccessStatusContractProperties """ super(KeyVaultContractProperties, self).__init__(secret_identifier=secret_identifier, identity_client_id=identity_client_id, **kwargs) self.last_status = last_status @@ -11402,7 +11432,7 @@ class LoggerCollection(msrest.serialization.Model): """Paged Logger list representation. :ivar value: Logger values. - :vartype value: list[~api_management_client.models.LoggerContract] + :vartype value: list[~azure.mgmt.apimanagement.models.LoggerContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -11425,7 +11455,7 @@ def __init__( ): """ :keyword value: Logger values. - :paramtype value: list[~api_management_client.models.LoggerContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.LoggerContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -11452,7 +11482,7 @@ class LoggerContract(Resource): :vartype type: str :ivar logger_type: Logger type. Possible values include: "azureEventHub", "applicationInsights", "azureMonitor". - :vartype logger_type: str or ~api_management_client.models.LoggerType + :vartype logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :ivar description: Logger description. :vartype description: str :ivar credentials: The name and SendRule connection string of the event hub for azureEventHub @@ -11498,7 +11528,7 @@ def __init__( """ :keyword logger_type: Logger type. Possible values include: "azureEventHub", "applicationInsights", "azureMonitor". - :paramtype logger_type: str or ~api_management_client.models.LoggerType + :paramtype logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :keyword description: Logger description. :paramtype description: str :keyword credentials: The name and SendRule connection string of the event hub for @@ -11525,7 +11555,7 @@ class LoggerUpdateContract(msrest.serialization.Model): :ivar logger_type: Logger type. Possible values include: "azureEventHub", "applicationInsights", "azureMonitor". - :vartype logger_type: str or ~api_management_client.models.LoggerType + :vartype logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :ivar description: Logger description. :vartype description: str :ivar credentials: Logger credentials. @@ -11554,7 +11584,7 @@ def __init__( """ :keyword logger_type: Logger type. Possible values include: "azureEventHub", "applicationInsights", "azureMonitor". - :paramtype logger_type: str or ~api_management_client.models.LoggerType + :paramtype logger_type: str or ~azure.mgmt.apimanagement.models.LoggerType :keyword description: Logger description. :paramtype description: str :keyword credentials: Logger credentials. @@ -11574,7 +11604,7 @@ class NamedValueCollection(msrest.serialization.Model): """Paged NamedValue list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.NamedValueContract] + :vartype value: list[~azure.mgmt.apimanagement.models.NamedValueContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -11597,7 +11627,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.NamedValueContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.NamedValueContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -11636,7 +11666,7 @@ class NamedValueContract(Resource): '/listSecrets' POST request to get the value. :vartype value: str :ivar key_vault: KeyVault location details of the namedValue. - :vartype key_vault: ~api_management_client.models.KeyVaultContractProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ _validation = { @@ -11684,7 +11714,7 @@ def __init__( '/listSecrets' POST request to get the value. :paramtype value: str :keyword key_vault: KeyVault location details of the namedValue. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ super(NamedValueContract, self).__init__(**kwargs) self.tags = tags @@ -11753,7 +11783,7 @@ class NamedValueContractProperties(NamedValueEntityBaseParameters): '/listSecrets' POST request to get the value. :vartype value: str :ivar key_vault: KeyVault location details of the namedValue. - :vartype key_vault: ~api_management_client.models.KeyVaultContractProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ _validation = { @@ -11795,7 +11825,7 @@ def __init__( '/listSecrets' POST request to get the value. :paramtype value: str :keyword key_vault: KeyVault location details of the namedValue. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractProperties """ super(NamedValueContractProperties, self).__init__(tags=tags, secret=secret, **kwargs) self.display_name = display_name @@ -11830,7 +11860,7 @@ class NamedValueCreateContract(Resource): '/listSecrets' POST request to get the value. :vartype value: str :ivar key_vault: KeyVault location details of the namedValue. - :vartype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -11878,7 +11908,7 @@ def __init__( '/listSecrets' POST request to get the value. :paramtype value: str :keyword key_vault: KeyVault location details of the namedValue. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ super(NamedValueCreateContract, self).__init__(**kwargs) self.tags = tags @@ -11907,7 +11937,7 @@ class NamedValueCreateContractProperties(NamedValueEntityBaseParameters): '/listSecrets' POST request to get the value. :vartype value: str :ivar key_vault: KeyVault location details of the namedValue. - :vartype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -11949,7 +11979,7 @@ def __init__( '/listSecrets' POST request to get the value. :paramtype value: str :keyword key_vault: KeyVault location details of the namedValue. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ super(NamedValueCreateContractProperties, self).__init__(tags=tags, secret=secret, **kwargs) self.display_name = display_name @@ -11998,7 +12028,7 @@ class NamedValueUpdateParameterProperties(NamedValueEntityBaseParameters): consist only of whitespace. :vartype value: str :ivar key_vault: KeyVault location details of the namedValue. - :vartype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -12039,7 +12069,7 @@ def __init__( consist only of whitespace. :paramtype value: str :keyword key_vault: KeyVault location details of the namedValue. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ super(NamedValueUpdateParameterProperties, self).__init__(tags=tags, secret=secret, **kwargs) self.display_name = display_name @@ -12063,7 +12093,7 @@ class NamedValueUpdateParameters(msrest.serialization.Model): consist only of whitespace. :vartype value: str :ivar key_vault: KeyVault location details of the namedValue. - :vartype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :vartype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ _validation = { @@ -12104,7 +12134,7 @@ def __init__( consist only of whitespace. :paramtype value: str :keyword key_vault: KeyVault location details of the namedValue. - :paramtype key_vault: ~api_management_client.models.KeyVaultContractCreateProperties + :paramtype key_vault: ~azure.mgmt.apimanagement.models.KeyVaultContractCreateProperties """ super(NamedValueUpdateParameters, self).__init__(**kwargs) self.tags = tags @@ -12123,7 +12153,7 @@ class NetworkStatusContract(msrest.serialization.Model): :vartype dns_servers: list[str] :ivar connectivity_status: Required. Gets the list of Connectivity Status to the Resources on which the service depends upon. - :vartype connectivity_status: list[~api_management_client.models.ConnectivityStatusContract] + :vartype connectivity_status: list[~azure.mgmt.apimanagement.models.ConnectivityStatusContract] """ _validation = { @@ -12148,7 +12178,8 @@ def __init__( :paramtype dns_servers: list[str] :keyword connectivity_status: Required. Gets the list of Connectivity Status to the Resources on which the service depends upon. - :paramtype connectivity_status: list[~api_management_client.models.ConnectivityStatusContract] + :paramtype connectivity_status: + list[~azure.mgmt.apimanagement.models.ConnectivityStatusContract] """ super(NetworkStatusContract, self).__init__(**kwargs) self.dns_servers = dns_servers @@ -12161,7 +12192,7 @@ class NetworkStatusContractByLocation(msrest.serialization.Model): :ivar location: Location of service. :vartype location: str :ivar network_status: Network status in Location. - :vartype network_status: ~api_management_client.models.NetworkStatusContract + :vartype network_status: ~azure.mgmt.apimanagement.models.NetworkStatusContract """ _validation = { @@ -12184,7 +12215,7 @@ def __init__( :keyword location: Location of service. :paramtype location: str :keyword network_status: Network status in Location. - :paramtype network_status: ~api_management_client.models.NetworkStatusContract + :paramtype network_status: ~azure.mgmt.apimanagement.models.NetworkStatusContract """ super(NetworkStatusContractByLocation, self).__init__(**kwargs) self.location = location @@ -12195,7 +12226,7 @@ class NotificationCollection(msrest.serialization.Model): """Paged Notification list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.NotificationContract] + :vartype value: list[~azure.mgmt.apimanagement.models.NotificationContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -12218,7 +12249,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.NotificationContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.NotificationContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -12248,7 +12279,7 @@ class NotificationContract(Resource): :ivar description: Description of the Notification. :vartype description: str :ivar recipients: Recipient Parameter values. - :vartype recipients: ~api_management_client.models.RecipientsContractProperties + :vartype recipients: ~azure.mgmt.apimanagement.models.RecipientsContractProperties """ _validation = { @@ -12281,7 +12312,7 @@ def __init__( :keyword description: Description of the Notification. :paramtype description: str :keyword recipients: Recipient Parameter values. - :paramtype recipients: ~api_management_client.models.RecipientsContractProperties + :paramtype recipients: ~azure.mgmt.apimanagement.models.RecipientsContractProperties """ super(NotificationContract, self).__init__(**kwargs) self.title = title @@ -12328,7 +12359,7 @@ class OpenIdAuthenticationSettingsContract(msrest.serialization.Model): :vartype openid_provider_id: str :ivar bearer_token_sending_methods: How to send token to the server. :vartype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethods] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethods] """ _attribute_map = { @@ -12348,7 +12379,7 @@ def __init__( :paramtype openid_provider_id: str :keyword bearer_token_sending_methods: How to send token to the server. :paramtype bearer_token_sending_methods: list[str or - ~api_management_client.models.BearerTokenSendingMethods] + ~azure.mgmt.apimanagement.models.BearerTokenSendingMethods] """ super(OpenIdAuthenticationSettingsContract, self).__init__(**kwargs) self.openid_provider_id = openid_provider_id @@ -12359,7 +12390,7 @@ class OpenIdConnectProviderCollection(msrest.serialization.Model): """Paged OpenIdProviders list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.OpenidConnectProviderContract] + :vartype value: list[~azure.mgmt.apimanagement.models.OpenidConnectProviderContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -12382,7 +12413,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.OpenidConnectProviderContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.OpenidConnectProviderContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -12530,7 +12561,7 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {provider}/{resource}/{operation}. :vartype name: str :ivar display: The object that describes the operation. - :vartype display: ~api_management_client.models.OperationDisplay + :vartype display: ~azure.mgmt.apimanagement.models.OperationDisplay :ivar origin: The operation origin. :vartype origin: str :ivar properties: The operation properties. @@ -12557,7 +12588,7 @@ def __init__( :keyword name: Operation name: {provider}/{resource}/{operation}. :paramtype name: str :keyword display: The object that describes the operation. - :paramtype display: ~api_management_client.models.OperationDisplay + :paramtype display: ~azure.mgmt.apimanagement.models.OperationDisplay :keyword origin: The operation origin. :paramtype origin: str :keyword properties: The operation properties. @@ -12576,7 +12607,7 @@ class OperationCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.OperationContract] + :vartype value: list[~azure.mgmt.apimanagement.models.OperationContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -12624,13 +12655,13 @@ class OperationContract(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar template_parameters: Collection of URL template parameters. - :vartype template_parameters: list[~api_management_client.models.ParameterContract] + :vartype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar description: Description of the operation. May include HTML formatting tags. :vartype description: str :ivar request: An entity containing request details. - :vartype request: ~api_management_client.models.RequestContract + :vartype request: ~azure.mgmt.apimanagement.models.RequestContract :ivar responses: Array of Operation responses. - :vartype responses: list[~api_management_client.models.ResponseContract] + :vartype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :ivar policies: Operation Policies. :vartype policies: str :ivar display_name: Operation Name. @@ -12681,13 +12712,13 @@ def __init__( ): """ :keyword template_parameters: Collection of URL template parameters. - :paramtype template_parameters: list[~api_management_client.models.ParameterContract] + :paramtype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword description: Description of the operation. May include HTML formatting tags. :paramtype description: str :keyword request: An entity containing request details. - :paramtype request: ~api_management_client.models.RequestContract + :paramtype request: ~azure.mgmt.apimanagement.models.RequestContract :keyword responses: Array of Operation responses. - :paramtype responses: list[~api_management_client.models.ResponseContract] + :paramtype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :keyword policies: Operation Policies. :paramtype policies: str :keyword display_name: Operation Name. @@ -12714,13 +12745,13 @@ class OperationEntityBaseContract(msrest.serialization.Model): """API Operation Entity Base Contract details. :ivar template_parameters: Collection of URL template parameters. - :vartype template_parameters: list[~api_management_client.models.ParameterContract] + :vartype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar description: Description of the operation. May include HTML formatting tags. :vartype description: str :ivar request: An entity containing request details. - :vartype request: ~api_management_client.models.RequestContract + :vartype request: ~azure.mgmt.apimanagement.models.RequestContract :ivar responses: Array of Operation responses. - :vartype responses: list[~api_management_client.models.ResponseContract] + :vartype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :ivar policies: Operation Policies. :vartype policies: str """ @@ -12749,13 +12780,13 @@ def __init__( ): """ :keyword template_parameters: Collection of URL template parameters. - :paramtype template_parameters: list[~api_management_client.models.ParameterContract] + :paramtype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword description: Description of the operation. May include HTML formatting tags. :paramtype description: str :keyword request: An entity containing request details. - :paramtype request: ~api_management_client.models.RequestContract + :paramtype request: ~azure.mgmt.apimanagement.models.RequestContract :keyword responses: Array of Operation responses. - :paramtype responses: list[~api_management_client.models.ResponseContract] + :paramtype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :keyword policies: Operation Policies. :paramtype policies: str """ @@ -12773,13 +12804,13 @@ class OperationContractProperties(OperationEntityBaseContract): All required parameters must be populated in order to send to Azure. :ivar template_parameters: Collection of URL template parameters. - :vartype template_parameters: list[~api_management_client.models.ParameterContract] + :vartype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar description: Description of the operation. May include HTML formatting tags. :vartype description: str :ivar request: An entity containing request details. - :vartype request: ~api_management_client.models.RequestContract + :vartype request: ~azure.mgmt.apimanagement.models.RequestContract :ivar responses: Array of Operation responses. - :vartype responses: list[~api_management_client.models.ResponseContract] + :vartype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :ivar policies: Operation Policies. :vartype policies: str :ivar display_name: Required. Operation Name. @@ -12825,13 +12856,13 @@ def __init__( ): """ :keyword template_parameters: Collection of URL template parameters. - :paramtype template_parameters: list[~api_management_client.models.ParameterContract] + :paramtype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword description: Description of the operation. May include HTML formatting tags. :paramtype description: str :keyword request: An entity containing request details. - :paramtype request: ~api_management_client.models.RequestContract + :paramtype request: ~azure.mgmt.apimanagement.models.RequestContract :keyword responses: Array of Operation responses. - :paramtype responses: list[~api_management_client.models.ResponseContract] + :paramtype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :keyword policies: Operation Policies. :paramtype policies: str :keyword display_name: Required. Operation Name. @@ -12899,7 +12930,7 @@ class OperationListResult(msrest.serialization.Model): """Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. :ivar value: List of operations supported by the resource provider. - :vartype value: list[~api_management_client.models.Operation] + :vartype value: list[~azure.mgmt.apimanagement.models.Operation] :ivar next_link: URL to get the next set of operation list results if there are any. :vartype next_link: str """ @@ -12918,7 +12949,7 @@ def __init__( ): """ :keyword value: List of operations supported by the resource provider. - :paramtype value: list[~api_management_client.models.Operation] + :paramtype value: list[~azure.mgmt.apimanagement.models.Operation] :keyword next_link: URL to get the next set of operation list results if there are any. :paramtype next_link: str """ @@ -12944,7 +12975,7 @@ class OperationResultContract(Resource): :vartype id_properties_id: str :ivar status: Status of an async operation. Possible values include: "Started", "InProgress", "Succeeded", "Failed". - :vartype status: str or ~api_management_client.models.AsyncOperationStatus + :vartype status: str or ~azure.mgmt.apimanagement.models.AsyncOperationStatus :ivar started: Start time of an async operation. The date conforms to the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :vartype started: ~datetime.datetime @@ -12954,11 +12985,11 @@ class OperationResultContract(Resource): :ivar result_info: Optional result info. :vartype result_info: str :ivar error: Error Body Contract. - :vartype error: ~api_management_client.models.ErrorResponseBody + :vartype error: ~azure.mgmt.apimanagement.models.ErrorResponseBody :ivar action_log: This property if only provided as part of the TenantConfiguration_Validate operation. It contains the log the entities which will be updated/created/deleted as part of the TenantConfiguration_Deploy operation. - :vartype action_log: list[~api_management_client.models.OperationResultLogItemContract] + :vartype action_log: list[~azure.mgmt.apimanagement.models.OperationResultLogItemContract] """ _validation = { @@ -12997,7 +13028,7 @@ def __init__( :paramtype id_properties_id: str :keyword status: Status of an async operation. Possible values include: "Started", "InProgress", "Succeeded", "Failed". - :paramtype status: str or ~api_management_client.models.AsyncOperationStatus + :paramtype status: str or ~azure.mgmt.apimanagement.models.AsyncOperationStatus :keyword started: Start time of an async operation. The date conforms to the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :paramtype started: ~datetime.datetime @@ -13007,7 +13038,7 @@ def __init__( :keyword result_info: Optional result info. :paramtype result_info: str :keyword error: Error Body Contract. - :paramtype error: ~api_management_client.models.ErrorResponseBody + :paramtype error: ~azure.mgmt.apimanagement.models.ErrorResponseBody """ super(OperationResultContract, self).__init__(**kwargs) self.id_properties_id = id_properties_id @@ -13129,13 +13160,13 @@ class OperationUpdateContract(msrest.serialization.Model): """API Operation Update Contract details. :ivar template_parameters: Collection of URL template parameters. - :vartype template_parameters: list[~api_management_client.models.ParameterContract] + :vartype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar description: Description of the operation. May include HTML formatting tags. :vartype description: str :ivar request: An entity containing request details. - :vartype request: ~api_management_client.models.RequestContract + :vartype request: ~azure.mgmt.apimanagement.models.RequestContract :ivar responses: Array of Operation responses. - :vartype responses: list[~api_management_client.models.ResponseContract] + :vartype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :ivar policies: Operation Policies. :vartype policies: str :ivar display_name: Operation Name. @@ -13180,13 +13211,13 @@ def __init__( ): """ :keyword template_parameters: Collection of URL template parameters. - :paramtype template_parameters: list[~api_management_client.models.ParameterContract] + :paramtype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword description: Description of the operation. May include HTML formatting tags. :paramtype description: str :keyword request: An entity containing request details. - :paramtype request: ~api_management_client.models.RequestContract + :paramtype request: ~azure.mgmt.apimanagement.models.RequestContract :keyword responses: Array of Operation responses. - :paramtype responses: list[~api_management_client.models.ResponseContract] + :paramtype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :keyword policies: Operation Policies. :paramtype policies: str :keyword display_name: Operation Name. @@ -13213,13 +13244,13 @@ class OperationUpdateContractProperties(OperationEntityBaseContract): """Operation Update Contract Properties. :ivar template_parameters: Collection of URL template parameters. - :vartype template_parameters: list[~api_management_client.models.ParameterContract] + :vartype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar description: Description of the operation. May include HTML formatting tags. :vartype description: str :ivar request: An entity containing request details. - :vartype request: ~api_management_client.models.RequestContract + :vartype request: ~azure.mgmt.apimanagement.models.RequestContract :ivar responses: Array of Operation responses. - :vartype responses: list[~api_management_client.models.ResponseContract] + :vartype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :ivar policies: Operation Policies. :vartype policies: str :ivar display_name: Operation Name. @@ -13264,13 +13295,13 @@ def __init__( ): """ :keyword template_parameters: Collection of URL template parameters. - :paramtype template_parameters: list[~api_management_client.models.ParameterContract] + :paramtype template_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword description: Description of the operation. May include HTML formatting tags. :paramtype description: str :keyword request: An entity containing request details. - :paramtype request: ~api_management_client.models.RequestContract + :paramtype request: ~azure.mgmt.apimanagement.models.RequestContract :keyword responses: Array of Operation responses. - :paramtype responses: list[~api_management_client.models.ResponseContract] + :paramtype responses: list[~azure.mgmt.apimanagement.models.ResponseContract] :keyword policies: Operation Policies. :paramtype policies: str :keyword display_name: Operation Name. @@ -13295,7 +13326,7 @@ class OutboundEnvironmentEndpoint(msrest.serialization.Model): Storage, Azure SQL Database, and Azure Active Directory. :vartype category: str :ivar endpoints: The endpoints that the Api Management Service reaches the service at. - :vartype endpoints: list[~api_management_client.models.EndpointDependency] + :vartype endpoints: list[~azure.mgmt.apimanagement.models.EndpointDependency] """ _attribute_map = { @@ -13315,7 +13346,7 @@ def __init__( Storage, Azure SQL Database, and Azure Active Directory. :paramtype category: str :keyword endpoints: The endpoints that the Api Management Service reaches the service at. - :paramtype endpoints: list[~api_management_client.models.EndpointDependency] + :paramtype endpoints: list[~azure.mgmt.apimanagement.models.EndpointDependency] """ super(OutboundEnvironmentEndpoint, self).__init__(**kwargs) self.category = category @@ -13330,7 +13361,7 @@ class OutboundEnvironmentEndpointList(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar value: Required. Collection of resources. - :vartype value: list[~api_management_client.models.OutboundEnvironmentEndpoint] + :vartype value: list[~azure.mgmt.apimanagement.models.OutboundEnvironmentEndpoint] :ivar next_link: Link to next page of resources. :vartype next_link: str """ @@ -13353,7 +13384,7 @@ def __init__( ): """ :keyword value: Required. Collection of resources. - :paramtype value: list[~api_management_client.models.OutboundEnvironmentEndpoint] + :paramtype value: list[~azure.mgmt.apimanagement.models.OutboundEnvironmentEndpoint] """ super(OutboundEnvironmentEndpointList, self).__init__(**kwargs) self.value = value @@ -13382,7 +13413,7 @@ class ParameterContract(msrest.serialization.Model): :ivar type_name: Type name defined by the schema. :vartype type_name: str :ivar examples: Exampled defined for the parameter. - :vartype examples: dict[str, ~api_management_client.models.ParameterExampleContract] + :vartype examples: dict[str, ~azure.mgmt.apimanagement.models.ParameterExampleContract] """ _validation = { @@ -13434,7 +13465,7 @@ def __init__( :keyword type_name: Type name defined by the schema. :paramtype type_name: str :keyword examples: Exampled defined for the parameter. - :paramtype examples: dict[str, ~api_management_client.models.ParameterExampleContract] + :paramtype examples: dict[str, ~azure.mgmt.apimanagement.models.ParameterExampleContract] """ super(ParameterContract, self).__init__(**kwargs) self.name = name @@ -13498,9 +13529,9 @@ class PipelineDiagnosticSettings(msrest.serialization.Model): """Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. :ivar request: Diagnostic settings for request. - :vartype request: ~api_management_client.models.HttpMessageDiagnostic + :vartype request: ~azure.mgmt.apimanagement.models.HttpMessageDiagnostic :ivar response: Diagnostic settings for response. - :vartype response: ~api_management_client.models.HttpMessageDiagnostic + :vartype response: ~azure.mgmt.apimanagement.models.HttpMessageDiagnostic """ _attribute_map = { @@ -13517,9 +13548,9 @@ def __init__( ): """ :keyword request: Diagnostic settings for request. - :paramtype request: ~api_management_client.models.HttpMessageDiagnostic + :paramtype request: ~azure.mgmt.apimanagement.models.HttpMessageDiagnostic :keyword response: Diagnostic settings for response. - :paramtype response: ~api_management_client.models.HttpMessageDiagnostic + :paramtype response: ~azure.mgmt.apimanagement.models.HttpMessageDiagnostic """ super(PipelineDiagnosticSettings, self).__init__(**kwargs) self.request = request @@ -13530,7 +13561,7 @@ class PolicyCollection(msrest.serialization.Model): """The response of the list policy operation. :ivar value: Policy Contract value. - :vartype value: list[~api_management_client.models.PolicyContract] + :vartype value: list[~azure.mgmt.apimanagement.models.PolicyContract] :ivar count: Total record count number. :vartype count: long :ivar next_link: Next page link if any. @@ -13553,7 +13584,7 @@ def __init__( ): """ :keyword value: Policy Contract value. - :paramtype value: list[~api_management_client.models.PolicyContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.PolicyContract] :keyword count: Total record count number. :paramtype count: long :keyword next_link: Next page link if any. @@ -13582,7 +13613,7 @@ class PolicyContract(Resource): :vartype value: str :ivar format: Format of the policyContent. Possible values include: "xml", "xml-link", "rawxml", "rawxml-link". Default value: "xml". - :vartype format: str or ~api_management_client.models.PolicyContentFormat + :vartype format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat """ _validation = { @@ -13611,7 +13642,7 @@ def __init__( :paramtype value: str :keyword format: Format of the policyContent. Possible values include: "xml", "xml-link", "rawxml", "rawxml-link". Default value: "xml". - :paramtype format: str or ~api_management_client.models.PolicyContentFormat + :paramtype format: str or ~azure.mgmt.apimanagement.models.PolicyContentFormat """ super(PolicyContract, self).__init__(**kwargs) self.value = value @@ -13622,7 +13653,7 @@ class PolicyDescriptionCollection(msrest.serialization.Model): """Descriptions of APIM policies. :ivar value: Descriptions of APIM policies. - :vartype value: list[~api_management_client.models.PolicyDescriptionContract] + :vartype value: list[~azure.mgmt.apimanagement.models.PolicyDescriptionContract] :ivar count: Total record count number. :vartype count: long """ @@ -13641,7 +13672,7 @@ def __init__( ): """ :keyword value: Descriptions of APIM policies. - :paramtype value: list[~api_management_client.models.PolicyDescriptionContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.PolicyDescriptionContract] :keyword count: Total record count number. :paramtype count: long """ @@ -13715,10 +13746,11 @@ class PortalDelegationSettings(Resource): from Azure API Management. :vartype validation_key: str :ivar subscriptions: Subscriptions delegation settings. - :vartype subscriptions: ~api_management_client.models.SubscriptionsDelegationSettingsProperties + :vartype subscriptions: + ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties :ivar user_registration: User registration delegation settings. :vartype user_registration: - ~api_management_client.models.RegistrationDelegationSettingsProperties + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties """ _validation = { @@ -13754,10 +13786,10 @@ def __init__( :paramtype validation_key: str :keyword subscriptions: Subscriptions delegation settings. :paramtype subscriptions: - ~api_management_client.models.SubscriptionsDelegationSettingsProperties + ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties :keyword user_registration: User registration delegation settings. :paramtype user_registration: - ~api_management_client.models.RegistrationDelegationSettingsProperties + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties """ super(PortalDelegationSettings, self).__init__(**kwargs) self.url = url @@ -13772,7 +13804,7 @@ class PortalRevisionCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Collection of portal revisions. - :vartype value: list[~api_management_client.models.PortalRevisionContract] + :vartype value: list[~azure.mgmt.apimanagement.models.PortalRevisionContract] :ivar next_link: Next page link, if any. :vartype next_link: str """ @@ -13817,7 +13849,7 @@ class PortalRevisionContract(Resource): :vartype status_details: str :ivar status: Status of the portal's revision. Possible values include: "pending", "publishing", "completed", "failed". - :vartype status: str or ~api_management_client.models.PortalRevisionStatus + :vartype status: str or ~azure.mgmt.apimanagement.models.PortalRevisionStatus :ivar is_current: Indicates if the portal's revision is public. :vartype is_current: bool :ivar created_date_time: Portal's revision creation date and time. @@ -13875,7 +13907,7 @@ class PortalSettingsCollection(msrest.serialization.Model): """Descriptions of APIM policies. :ivar value: Descriptions of APIM policies. - :vartype value: list[~api_management_client.models.PortalSettingsContract] + :vartype value: list[~azure.mgmt.apimanagement.models.PortalSettingsContract] :ivar count: Total record count number. :vartype count: long """ @@ -13894,7 +13926,7 @@ def __init__( ): """ :keyword value: Descriptions of APIM policies. - :paramtype value: list[~api_management_client.models.PortalSettingsContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.PortalSettingsContract] :keyword count: Total record count number. :paramtype count: long """ @@ -13922,14 +13954,15 @@ class PortalSettingsContract(Resource): from Azure API Management. :vartype validation_key: str :ivar subscriptions: Subscriptions delegation settings. - :vartype subscriptions: ~api_management_client.models.SubscriptionsDelegationSettingsProperties + :vartype subscriptions: + ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties :ivar user_registration: User registration delegation settings. :vartype user_registration: - ~api_management_client.models.RegistrationDelegationSettingsProperties + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties :ivar enabled: Redirect Anonymous users to the Sign-In page. :vartype enabled: bool :ivar terms_of_service: Terms of service contract properties. - :vartype terms_of_service: ~api_management_client.models.TermsOfServiceProperties + :vartype terms_of_service: ~azure.mgmt.apimanagement.models.TermsOfServiceProperties """ _validation = { @@ -13969,14 +14002,14 @@ def __init__( :paramtype validation_key: str :keyword subscriptions: Subscriptions delegation settings. :paramtype subscriptions: - ~api_management_client.models.SubscriptionsDelegationSettingsProperties + ~azure.mgmt.apimanagement.models.SubscriptionsDelegationSettingsProperties :keyword user_registration: User registration delegation settings. :paramtype user_registration: - ~api_management_client.models.RegistrationDelegationSettingsProperties + ~azure.mgmt.apimanagement.models.RegistrationDelegationSettingsProperties :keyword enabled: Redirect Anonymous users to the Sign-In page. :paramtype enabled: bool :keyword terms_of_service: Terms of service contract properties. - :paramtype terms_of_service: ~api_management_client.models.TermsOfServiceProperties + :paramtype terms_of_service: ~azure.mgmt.apimanagement.models.TermsOfServiceProperties """ super(PortalSettingsContract, self).__init__(**kwargs) self.url = url @@ -14072,7 +14105,7 @@ class PortalSignupSettings(Resource): :ivar enabled: Allow users to sign up on a developer portal. :vartype enabled: bool :ivar terms_of_service: Terms of service contract properties. - :vartype terms_of_service: ~api_management_client.models.TermsOfServiceProperties + :vartype terms_of_service: ~azure.mgmt.apimanagement.models.TermsOfServiceProperties """ _validation = { @@ -14100,7 +14133,7 @@ def __init__( :keyword enabled: Allow users to sign up on a developer portal. :paramtype enabled: bool :keyword terms_of_service: Terms of service contract properties. - :paramtype terms_of_service: ~api_management_client.models.TermsOfServiceProperties + :paramtype terms_of_service: ~azure.mgmt.apimanagement.models.TermsOfServiceProperties """ super(PortalSignupSettings, self).__init__(**kwargs) self.enabled = enabled @@ -14148,15 +14181,15 @@ class PrivateEndpointConnection(Resource): "Microsoft.Storage/storageAccounts". :vartype type: str :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~api_management_client.models.PrivateEndpoint + :vartype private_endpoint: ~azure.mgmt.apimanagement.models.PrivateEndpoint :ivar private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :vartype private_link_service_connection_state: - ~api_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.apimanagement.models.PrivateLinkServiceConnectionState :ivar provisioning_state: The provisioning state of the private endpoint connection resource. Possible values include: "Succeeded", "Creating", "Deleting", "Failed". :vartype provisioning_state: str or - ~api_management_client.models.PrivateEndpointConnectionProvisioningState + ~azure.mgmt.apimanagement.models.PrivateEndpointConnectionProvisioningState """ _validation = { @@ -14184,11 +14217,11 @@ def __init__( ): """ :keyword private_endpoint: The resource of private end point. - :paramtype private_endpoint: ~api_management_client.models.PrivateEndpoint + :paramtype private_endpoint: ~azure.mgmt.apimanagement.models.PrivateEndpoint :keyword private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :paramtype private_link_service_connection_state: - ~api_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.apimanagement.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnection, self).__init__(**kwargs) self.private_endpoint = private_endpoint @@ -14200,7 +14233,7 @@ class PrivateEndpointConnectionListResult(msrest.serialization.Model): """List of private endpoint connection associated with the specified storage account. :ivar value: Array of private endpoint connections. - :vartype value: list[~api_management_client.models.PrivateEndpointConnection] + :vartype value: list[~azure.mgmt.apimanagement.models.PrivateEndpointConnection] """ _attribute_map = { @@ -14215,7 +14248,7 @@ def __init__( ): """ :keyword value: Array of private endpoint connections. - :paramtype value: list[~api_management_client.models.PrivateEndpointConnection] + :paramtype value: list[~azure.mgmt.apimanagement.models.PrivateEndpointConnection] """ super(PrivateEndpointConnectionListResult, self).__init__(**kwargs) self.value = value @@ -14227,7 +14260,8 @@ class PrivateEndpointConnectionRequest(msrest.serialization.Model): :ivar id: Private Endpoint Connection Resource Id. :vartype id: str :ivar properties: The connection state of the private endpoint connection. - :vartype properties: ~api_management_client.models.PrivateEndpointConnectionRequestProperties + :vartype properties: + ~azure.mgmt.apimanagement.models.PrivateEndpointConnectionRequestProperties """ _attribute_map = { @@ -14246,7 +14280,8 @@ def __init__( :keyword id: Private Endpoint Connection Resource Id. :paramtype id: str :keyword properties: The connection state of the private endpoint connection. - :paramtype properties: ~api_management_client.models.PrivateEndpointConnectionRequestProperties + :paramtype properties: + ~azure.mgmt.apimanagement.models.PrivateEndpointConnectionRequestProperties """ super(PrivateEndpointConnectionRequest, self).__init__(**kwargs) self.id = id @@ -14259,7 +14294,7 @@ class PrivateEndpointConnectionRequestProperties(msrest.serialization.Model): :ivar private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :vartype private_link_service_connection_state: - ~api_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.apimanagement.models.PrivateLinkServiceConnectionState """ _attribute_map = { @@ -14276,7 +14311,7 @@ def __init__( :keyword private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :paramtype private_link_service_connection_state: - ~api_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.apimanagement.models.PrivateLinkServiceConnectionState """ super(PrivateEndpointConnectionRequestProperties, self).__init__(**kwargs) self.private_link_service_connection_state = private_link_service_connection_state @@ -14340,7 +14375,7 @@ class PrivateLinkResourceListResult(msrest.serialization.Model): """A list of private link resources. :ivar value: Array of private link resources. - :vartype value: list[~api_management_client.models.PrivateLinkResource] + :vartype value: list[~azure.mgmt.apimanagement.models.PrivateLinkResource] """ _attribute_map = { @@ -14355,7 +14390,7 @@ def __init__( ): """ :keyword value: Array of private link resources. - :paramtype value: list[~api_management_client.models.PrivateLinkResource] + :paramtype value: list[~azure.mgmt.apimanagement.models.PrivateLinkResource] """ super(PrivateLinkResourceListResult, self).__init__(**kwargs) self.value = value @@ -14366,7 +14401,7 @@ class PrivateLinkServiceConnectionState(msrest.serialization.Model): :ivar status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected". - :vartype status: str or ~api_management_client.models.PrivateEndpointServiceConnectionStatus + :vartype status: str or ~azure.mgmt.apimanagement.models.PrivateEndpointServiceConnectionStatus :ivar description: The reason for approval/rejection of the connection. :vartype description: str :ivar actions_required: A message indicating if changes on the service provider require any @@ -14391,7 +14426,8 @@ def __init__( """ :keyword status: Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: "Pending", "Approved", "Rejected". - :paramtype status: str or ~api_management_client.models.PrivateEndpointServiceConnectionStatus + :paramtype status: str or + ~azure.mgmt.apimanagement.models.PrivateEndpointServiceConnectionStatus :keyword description: The reason for approval/rejection of the connection. :paramtype description: str :keyword actions_required: A message indicating if changes on the service provider require any @@ -14408,7 +14444,7 @@ class ProductCollection(msrest.serialization.Model): """Paged Products list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.ProductContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ProductContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -14431,7 +14467,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.ProductContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.ProductContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -14481,7 +14517,7 @@ class ProductContract(Resource): :ivar state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :vartype state: str or ~api_management_client.models.ProductState + :vartype state: str or ~azure.mgmt.apimanagement.models.ProductState :ivar display_name: Product name. :vartype display_name: str """ @@ -14545,7 +14581,7 @@ def __init__( :keyword state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :paramtype state: str or ~api_management_client.models.ProductState + :paramtype state: str or ~azure.mgmt.apimanagement.models.ProductState :keyword display_name: Product name. :paramtype display_name: str """ @@ -14587,7 +14623,7 @@ class ProductEntityBaseParameters(msrest.serialization.Model): :ivar state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :vartype state: str or ~api_management_client.models.ProductState + :vartype state: str or ~azure.mgmt.apimanagement.models.ProductState """ _validation = { @@ -14640,7 +14676,7 @@ def __init__( :keyword state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :paramtype state: str or ~api_management_client.models.ProductState + :paramtype state: str or ~azure.mgmt.apimanagement.models.ProductState """ super(ProductEntityBaseParameters, self).__init__(**kwargs) self.description = description @@ -14681,7 +14717,7 @@ class ProductContractProperties(ProductEntityBaseParameters): :ivar state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :vartype state: str or ~api_management_client.models.ProductState + :vartype state: str or ~azure.mgmt.apimanagement.models.ProductState :ivar display_name: Required. Product name. :vartype display_name: str """ @@ -14739,7 +14775,7 @@ def __init__( :keyword state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :paramtype state: str or ~api_management_client.models.ProductState + :paramtype state: str or ~azure.mgmt.apimanagement.models.ProductState :keyword display_name: Required. Product name. :paramtype display_name: str """ @@ -14777,7 +14813,7 @@ class ProductTagResourceContractProperties(ProductEntityBaseParameters): :ivar state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :vartype state: str or ~api_management_client.models.ProductState + :vartype state: str or ~azure.mgmt.apimanagement.models.ProductState :ivar id: Identifier of the product in the form of /products/{productId}. :vartype id: str :ivar name: Required. Product name. @@ -14839,7 +14875,7 @@ def __init__( :keyword state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :paramtype state: str or ~api_management_client.models.ProductState + :paramtype state: str or ~azure.mgmt.apimanagement.models.ProductState :keyword id: Identifier of the product in the form of /products/{productId}. :paramtype id: str :keyword name: Required. Product name. @@ -14878,7 +14914,7 @@ class ProductUpdateParameters(msrest.serialization.Model): :ivar state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :vartype state: str or ~api_management_client.models.ProductState + :vartype state: str or ~azure.mgmt.apimanagement.models.ProductState :ivar display_name: Product name. :vartype display_name: str """ @@ -14936,7 +14972,7 @@ def __init__( :keyword state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :paramtype state: str or ~api_management_client.models.ProductState + :paramtype state: str or ~azure.mgmt.apimanagement.models.ProductState :keyword display_name: Product name. :paramtype display_name: str """ @@ -14978,7 +15014,7 @@ class ProductUpdateProperties(ProductEntityBaseParameters): :ivar state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :vartype state: str or ~api_management_client.models.ProductState + :vartype state: str or ~azure.mgmt.apimanagement.models.ProductState :ivar display_name: Product name. :vartype display_name: str """ @@ -15036,7 +15072,7 @@ def __init__( :keyword state: whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: "notPublished", "published". - :paramtype state: str or ~api_management_client.models.ProductState + :paramtype state: str or ~azure.mgmt.apimanagement.models.ProductState :keyword display_name: Product name. :paramtype display_name: str """ @@ -15048,7 +15084,7 @@ class QuotaCounterCollection(msrest.serialization.Model): """Paged Quota Counter list representation. :ivar value: Quota counter values. - :vartype value: list[~api_management_client.models.QuotaCounterContract] + :vartype value: list[~azure.mgmt.apimanagement.models.QuotaCounterContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -15071,7 +15107,7 @@ def __init__( ): """ :keyword value: Quota counter values. - :paramtype value: list[~api_management_client.models.QuotaCounterContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.QuotaCounterContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -15100,7 +15136,7 @@ class QuotaCounterContract(msrest.serialization.Model): the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :vartype period_end_time: ~datetime.datetime :ivar value: Quota Value Properties. - :vartype value: ~api_management_client.models.QuotaCounterValueContractProperties + :vartype value: ~azure.mgmt.apimanagement.models.QuotaCounterValueContractProperties """ _validation = { @@ -15142,7 +15178,7 @@ def __init__( the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :paramtype period_end_time: ~datetime.datetime :keyword value: Quota Value Properties. - :paramtype value: ~api_management_client.models.QuotaCounterValueContractProperties + :paramtype value: ~azure.mgmt.apimanagement.models.QuotaCounterValueContractProperties """ super(QuotaCounterContract, self).__init__(**kwargs) self.counter_key = counter_key @@ -15252,7 +15288,7 @@ class RecipientEmailCollection(msrest.serialization.Model): """Paged Recipient User list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.RecipientEmailContract] + :vartype value: list[~azure.mgmt.apimanagement.models.RecipientEmailContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -15275,7 +15311,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.RecipientEmailContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.RecipientEmailContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -15367,7 +15403,7 @@ class RecipientUserCollection(msrest.serialization.Model): """Paged Recipient User list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.RecipientUserContract] + :vartype value: list[~azure.mgmt.apimanagement.models.RecipientUserContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -15390,7 +15426,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.RecipientUserContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.RecipientUserContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -15492,7 +15528,7 @@ class RegionListResult(msrest.serialization.Model): """Lists Regions operation response details. :ivar value: Lists of Regions. - :vartype value: list[~api_management_client.models.RegionContract] + :vartype value: list[~azure.mgmt.apimanagement.models.RegionContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -15515,7 +15551,7 @@ def __init__( ): """ :keyword value: Lists of Regions. - :paramtype value: list[~api_management_client.models.RegionContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.RegionContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -15564,11 +15600,11 @@ class RemotePrivateEndpointConnectionWrapper(msrest.serialization.Model): :ivar type: Private Endpoint Connection Resource Type. :vartype type: str :ivar private_endpoint: The resource of private end point. - :vartype private_endpoint: ~api_management_client.models.ArmIdWrapper + :vartype private_endpoint: ~azure.mgmt.apimanagement.models.ArmIdWrapper :ivar private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :vartype private_link_service_connection_state: - ~api_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.apimanagement.models.PrivateLinkServiceConnectionState :ivar provisioning_state: The provisioning state of the private endpoint connection resource. :vartype provisioning_state: str :ivar group_ids: All the Group ids. @@ -15608,11 +15644,11 @@ def __init__( :keyword type: Private Endpoint Connection Resource Type. :paramtype type: str :keyword private_endpoint: The resource of private end point. - :paramtype private_endpoint: ~api_management_client.models.ArmIdWrapper + :paramtype private_endpoint: ~azure.mgmt.apimanagement.models.ArmIdWrapper :keyword private_link_service_connection_state: A collection of information about the state of the connection between service consumer and provider. :paramtype private_link_service_connection_state: - ~api_management_client.models.PrivateLinkServiceConnectionState + ~azure.mgmt.apimanagement.models.PrivateLinkServiceConnectionState """ super(RemotePrivateEndpointConnectionWrapper, self).__init__(**kwargs) self.id = id @@ -15628,7 +15664,7 @@ class ReportCollection(msrest.serialization.Model): """Paged Report records list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.ReportRecordContract] + :vartype value: list[~azure.mgmt.apimanagement.models.ReportRecordContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -15651,7 +15687,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.ReportRecordContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.ReportRecordContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -15898,9 +15934,9 @@ class RepresentationContract(msrest.serialization.Model): :vartype type_name: str :ivar form_parameters: Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. - :vartype form_parameters: list[~api_management_client.models.ParameterContract] + :vartype form_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar examples: Exampled defined for the representation. - :vartype examples: dict[str, ~api_management_client.models.ParameterExampleContract] + :vartype examples: dict[str, ~azure.mgmt.apimanagement.models.ParameterExampleContract] """ _validation = { @@ -15937,9 +15973,9 @@ def __init__( :paramtype type_name: str :keyword form_parameters: Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'.. - :paramtype form_parameters: list[~api_management_client.models.ParameterContract] + :paramtype form_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword examples: Exampled defined for the representation. - :paramtype examples: dict[str, ~api_management_client.models.ParameterExampleContract] + :paramtype examples: dict[str, ~azure.mgmt.apimanagement.models.ParameterExampleContract] """ super(RepresentationContract, self).__init__(**kwargs) self.content_type = content_type @@ -15955,11 +15991,11 @@ class RequestContract(msrest.serialization.Model): :ivar description: Operation request description. :vartype description: str :ivar query_parameters: Collection of operation request query parameters. - :vartype query_parameters: list[~api_management_client.models.ParameterContract] + :vartype query_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar headers: Collection of operation request headers. - :vartype headers: list[~api_management_client.models.ParameterContract] + :vartype headers: list[~azure.mgmt.apimanagement.models.ParameterContract] :ivar representations: Collection of operation request representations. - :vartype representations: list[~api_management_client.models.RepresentationContract] + :vartype representations: list[~azure.mgmt.apimanagement.models.RepresentationContract] """ _attribute_map = { @@ -15982,11 +16018,11 @@ def __init__( :keyword description: Operation request description. :paramtype description: str :keyword query_parameters: Collection of operation request query parameters. - :paramtype query_parameters: list[~api_management_client.models.ParameterContract] + :paramtype query_parameters: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword headers: Collection of operation request headers. - :paramtype headers: list[~api_management_client.models.ParameterContract] + :paramtype headers: list[~azure.mgmt.apimanagement.models.ParameterContract] :keyword representations: Collection of operation request representations. - :paramtype representations: list[~api_management_client.models.RepresentationContract] + :paramtype representations: list[~azure.mgmt.apimanagement.models.RepresentationContract] """ super(RequestContract, self).__init__(**kwargs) self.description = description @@ -15999,7 +16035,7 @@ class RequestReportCollection(msrest.serialization.Model): """Paged Report records list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.RequestReportRecordContract] + :vartype value: list[~azure.mgmt.apimanagement.models.RequestReportRecordContract] :ivar count: Total record count number across all pages. :vartype count: long """ @@ -16018,7 +16054,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.RequestReportRecordContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.RequestReportRecordContract] :keyword count: Total record count number across all pages. :paramtype count: long """ @@ -16244,7 +16280,7 @@ class ResourceSku(msrest.serialization.Model): :ivar name: Name of the Sku. Possible values include: "Developer", "Standard", "Premium", "Basic", "Consumption", "Isolated". - :vartype name: str or ~api_management_client.models.SkuType + :vartype name: str or ~azure.mgmt.apimanagement.models.SkuType """ _attribute_map = { @@ -16260,7 +16296,7 @@ def __init__( """ :keyword name: Name of the Sku. Possible values include: "Developer", "Standard", "Premium", "Basic", "Consumption", "Isolated". - :paramtype name: str or ~api_management_client.models.SkuType + :paramtype name: str or ~azure.mgmt.apimanagement.models.SkuType """ super(ResourceSku, self).__init__(**kwargs) self.name = name @@ -16279,7 +16315,7 @@ class ResourceSkuCapacity(msrest.serialization.Model): :vartype default: int :ivar scale_type: The scale type applicable to the sku. Possible values include: "automatic", "manual", "none". - :vartype scale_type: str or ~api_management_client.models.ResourceSkuCapacityScaleType + :vartype scale_type: str or ~azure.mgmt.apimanagement.models.ResourceSkuCapacityScaleType """ _validation = { @@ -16317,9 +16353,9 @@ class ResourceSkuResult(msrest.serialization.Model): :ivar resource_type: The type of resource the SKU applies to. :vartype resource_type: str :ivar sku: Specifies API Management SKU. - :vartype sku: ~api_management_client.models.ResourceSku + :vartype sku: ~azure.mgmt.apimanagement.models.ResourceSku :ivar capacity: Specifies the number of API Management units. - :vartype capacity: ~api_management_client.models.ResourceSkuCapacity + :vartype capacity: ~azure.mgmt.apimanagement.models.ResourceSkuCapacity """ _validation = { @@ -16352,7 +16388,7 @@ class ResourceSkuResults(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar value: Required. The list of skus available for the service. - :vartype value: list[~api_management_client.models.ResourceSkuResult] + :vartype value: list[~azure.mgmt.apimanagement.models.ResourceSkuResult] :ivar next_link: The uri to fetch the next page of API Management service Skus. :vartype next_link: str """ @@ -16375,7 +16411,7 @@ def __init__( ): """ :keyword value: Required. The list of skus available for the service. - :paramtype value: list[~api_management_client.models.ResourceSkuResult] + :paramtype value: list[~azure.mgmt.apimanagement.models.ResourceSkuResult] :keyword next_link: The uri to fetch the next page of API Management service Skus. :paramtype next_link: str """ @@ -16394,9 +16430,9 @@ class ResponseContract(msrest.serialization.Model): :ivar description: Operation response description. :vartype description: str :ivar representations: Collection of operation response representations. - :vartype representations: list[~api_management_client.models.RepresentationContract] + :vartype representations: list[~azure.mgmt.apimanagement.models.RepresentationContract] :ivar headers: Collection of operation response headers. - :vartype headers: list[~api_management_client.models.ParameterContract] + :vartype headers: list[~azure.mgmt.apimanagement.models.ParameterContract] """ _validation = { @@ -16425,9 +16461,9 @@ def __init__( :keyword description: Operation response description. :paramtype description: str :keyword representations: Collection of operation response representations. - :paramtype representations: list[~api_management_client.models.RepresentationContract] + :paramtype representations: list[~azure.mgmt.apimanagement.models.RepresentationContract] :keyword headers: Collection of operation response headers. - :paramtype headers: list[~api_management_client.models.ParameterContract] + :paramtype headers: list[~azure.mgmt.apimanagement.models.ParameterContract] """ super(ResponseContract, self).__init__(**kwargs) self.status_code = status_code @@ -16440,7 +16476,7 @@ class SamplingSettings(msrest.serialization.Model): """Sampling settings for Diagnostic. :ivar sampling_type: Sampling type. Possible values include: "fixed". - :vartype sampling_type: str or ~api_management_client.models.SamplingType + :vartype sampling_type: str or ~azure.mgmt.apimanagement.models.SamplingType :ivar percentage: Rate of sampling for fixed-rate sampling. :vartype percentage: float """ @@ -16463,7 +16499,7 @@ def __init__( ): """ :keyword sampling_type: Sampling type. Possible values include: "fixed". - :paramtype sampling_type: str or ~api_management_client.models.SamplingType + :paramtype sampling_type: str or ~azure.mgmt.apimanagement.models.SamplingType :keyword percentage: Rate of sampling for fixed-rate sampling. :paramtype percentage: float """ @@ -16513,7 +16549,7 @@ class SchemaCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: API Schema Contract value. - :vartype value: list[~api_management_client.models.SchemaContract] + :vartype value: list[~azure.mgmt.apimanagement.models.SchemaContract] :ivar count: Total record count number. :vartype count: long :ivar next_link: Next page link if any. @@ -16631,7 +16667,7 @@ class SubscriptionCollection(msrest.serialization.Model): """Paged Subscriptions list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.SubscriptionContract] + :vartype value: list[~azure.mgmt.apimanagement.models.SubscriptionContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -16654,7 +16690,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.SubscriptionContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.SubscriptionContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -16694,7 +16730,7 @@ class SubscriptionContract(Resource): administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: "suspended", "active", "expired", "submitted", "rejected", "cancelled". - :vartype state: str or ~api_management_client.models.SubscriptionState + :vartype state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :ivar created_date: Subscription creation date. The date conforms to the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :vartype created_date: ~datetime.datetime @@ -16791,7 +16827,7 @@ def __init__( administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: "suspended", "active", "expired", "submitted", "rejected", "cancelled". - :paramtype state: str or ~api_management_client.models.SubscriptionState + :paramtype state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :keyword start_date: Subscription activation date. The setting is for audit purposes only and the subscription is not automatically activated. The subscription lifecycle can be managed by using the ``state`` property. The date conforms to the following format: @@ -16863,7 +16899,7 @@ class SubscriptionCreateParameters(msrest.serialization.Model): cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: "suspended", "active", "expired", "submitted", "rejected", "cancelled". - :vartype state: str or ~api_management_client.models.SubscriptionState + :vartype state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :ivar allow_tracing: Determines whether tracing can be enabled. :vartype allow_tracing: bool """ @@ -16919,7 +16955,7 @@ def __init__( administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: "suspended", "active", "expired", "submitted", "rejected", "cancelled". - :paramtype state: str or ~api_management_client.models.SubscriptionState + :paramtype state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :keyword allow_tracing: Determines whether tracing can be enabled. :paramtype allow_tracing: bool """ @@ -17053,7 +17089,7 @@ class SubscriptionUpdateParameters(msrest.serialization.Model): administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: "suspended", "active", "expired", "submitted", "rejected", "cancelled". - :vartype state: str or ~api_management_client.models.SubscriptionState + :vartype state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :ivar state_comment: Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. :vartype state_comment: str @@ -17116,7 +17152,7 @@ def __init__( administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: "suspended", "active", "expired", "submitted", "rejected", "cancelled". - :paramtype state: str or ~api_management_client.models.SubscriptionState + :paramtype state: str or ~azure.mgmt.apimanagement.models.SubscriptionState :keyword state_comment: Comments describing subscription state change by the administrator when the state is changed to the 'rejected'. :paramtype state_comment: str @@ -17142,14 +17178,14 @@ class SystemData(msrest.serialization.Model): :vartype created_by: str :ivar created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype created_by_type: str or ~api_management_client.models.CreatedByType + :vartype created_by_type: str or ~azure.mgmt.apimanagement.models.CreatedByType :ivar created_at: The timestamp of resource creation (UTC). :vartype created_at: ~datetime.datetime :ivar last_modified_by: The identity that last modified the resource. :vartype last_modified_by: str :ivar last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :vartype last_modified_by_type: str or ~api_management_client.models.CreatedByType + :vartype last_modified_by_type: str or ~azure.mgmt.apimanagement.models.CreatedByType :ivar last_modified_at: The timestamp of resource last modification (UTC). :vartype last_modified_at: ~datetime.datetime """ @@ -17179,14 +17215,14 @@ def __init__( :paramtype created_by: str :keyword created_by_type: The type of identity that created the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype created_by_type: str or ~api_management_client.models.CreatedByType + :paramtype created_by_type: str or ~azure.mgmt.apimanagement.models.CreatedByType :keyword created_at: The timestamp of resource creation (UTC). :paramtype created_at: ~datetime.datetime :keyword last_modified_by: The identity that last modified the resource. :paramtype last_modified_by: str :keyword last_modified_by_type: The type of identity that last modified the resource. Possible values include: "User", "Application", "ManagedIdentity", "Key". - :paramtype last_modified_by_type: str or ~api_management_client.models.CreatedByType + :paramtype last_modified_by_type: str or ~azure.mgmt.apimanagement.models.CreatedByType :keyword last_modified_at: The timestamp of resource last modification (UTC). :paramtype last_modified_at: ~datetime.datetime """ @@ -17203,7 +17239,7 @@ class TagCollection(msrest.serialization.Model): """Paged Tag list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.TagContract] + :vartype value: list[~azure.mgmt.apimanagement.models.TagContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -17226,7 +17262,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.TagContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.TagContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -17359,7 +17395,7 @@ class TagDescriptionCollection(msrest.serialization.Model): """Paged TagDescription list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.TagDescriptionContract] + :vartype value: list[~azure.mgmt.apimanagement.models.TagDescriptionContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -17382,7 +17418,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.TagDescriptionContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.TagDescriptionContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -17570,7 +17606,7 @@ class TagResourceCollection(msrest.serialization.Model): """Paged Tag list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.TagResourceContract] + :vartype value: list[~azure.mgmt.apimanagement.models.TagResourceContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -17593,7 +17629,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.TagResourceContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.TagResourceContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -17611,13 +17647,13 @@ class TagResourceContract(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar tag: Required. Tag associated with the resource. - :vartype tag: ~api_management_client.models.TagResourceContractProperties + :vartype tag: ~azure.mgmt.apimanagement.models.TagResourceContractProperties :ivar api: API associated with the tag. - :vartype api: ~api_management_client.models.ApiTagResourceContractProperties + :vartype api: ~azure.mgmt.apimanagement.models.ApiTagResourceContractProperties :ivar operation: Operation associated with the tag. - :vartype operation: ~api_management_client.models.OperationTagResourceContractProperties + :vartype operation: ~azure.mgmt.apimanagement.models.OperationTagResourceContractProperties :ivar product: Product associated with the tag. - :vartype product: ~api_management_client.models.ProductTagResourceContractProperties + :vartype product: ~azure.mgmt.apimanagement.models.ProductTagResourceContractProperties """ _validation = { @@ -17642,13 +17678,13 @@ def __init__( ): """ :keyword tag: Required. Tag associated with the resource. - :paramtype tag: ~api_management_client.models.TagResourceContractProperties + :paramtype tag: ~azure.mgmt.apimanagement.models.TagResourceContractProperties :keyword api: API associated with the tag. - :paramtype api: ~api_management_client.models.ApiTagResourceContractProperties + :paramtype api: ~azure.mgmt.apimanagement.models.ApiTagResourceContractProperties :keyword operation: Operation associated with the tag. - :paramtype operation: ~api_management_client.models.OperationTagResourceContractProperties + :paramtype operation: ~azure.mgmt.apimanagement.models.OperationTagResourceContractProperties :keyword product: Product associated with the tag. - :paramtype product: ~api_management_client.models.ProductTagResourceContractProperties + :paramtype product: ~azure.mgmt.apimanagement.models.ProductTagResourceContractProperties """ super(TagResourceContract, self).__init__(**kwargs) self.tag = tag @@ -17799,7 +17835,7 @@ class TenantSettingsCollection(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: Page values. - :vartype value: list[~api_management_client.models.TenantSettingsContract] + :vartype value: list[~azure.mgmt.apimanagement.models.TenantSettingsContract] :ivar next_link: Next page link if any. :vartype next_link: str """ @@ -17951,7 +17987,7 @@ class UserCollection(msrest.serialization.Model): """Paged Users list representation. :ivar value: Page values. - :vartype value: list[~api_management_client.models.UserContract] + :vartype value: list[~azure.mgmt.apimanagement.models.UserContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -17974,7 +18010,7 @@ def __init__( ): """ :keyword value: Page values. - :paramtype value: list[~api_management_client.models.UserContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.UserContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -18003,11 +18039,11 @@ class UserContract(Resource): unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :vartype state: str or ~api_management_client.models.UserState + :vartype state: str or ~azure.mgmt.apimanagement.models.UserState :ivar note: Optional note about a user set by the administrator. :vartype note: str :ivar identities: Collection of user identities. - :vartype identities: list[~api_management_client.models.UserIdentityContract] + :vartype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :ivar first_name: First name. :vartype first_name: str :ivar last_name: Last name. @@ -18018,7 +18054,7 @@ class UserContract(Resource): ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :vartype registration_date: ~datetime.datetime :ivar groups: Collection of groups user is part of. - :vartype groups: list[~api_management_client.models.GroupContractProperties] + :vartype groups: list[~azure.mgmt.apimanagement.models.GroupContractProperties] """ _validation = { @@ -18059,11 +18095,11 @@ def __init__( unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :paramtype state: str or ~api_management_client.models.UserState + :paramtype state: str or ~azure.mgmt.apimanagement.models.UserState :keyword note: Optional note about a user set by the administrator. :paramtype note: str :keyword identities: Collection of user identities. - :paramtype identities: list[~api_management_client.models.UserIdentityContract] + :paramtype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :keyword first_name: First name. :paramtype first_name: str :keyword last_name: Last name. @@ -18092,11 +18128,11 @@ class UserEntityBaseParameters(msrest.serialization.Model): unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :vartype state: str or ~api_management_client.models.UserState + :vartype state: str or ~azure.mgmt.apimanagement.models.UserState :ivar note: Optional note about a user set by the administrator. :vartype note: str :ivar identities: Collection of user identities. - :vartype identities: list[~api_management_client.models.UserIdentityContract] + :vartype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] """ _attribute_map = { @@ -18118,11 +18154,11 @@ def __init__( unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :paramtype state: str or ~api_management_client.models.UserState + :paramtype state: str or ~azure.mgmt.apimanagement.models.UserState :keyword note: Optional note about a user set by the administrator. :paramtype note: str :keyword identities: Collection of user identities. - :paramtype identities: list[~api_management_client.models.UserIdentityContract] + :paramtype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] """ super(UserEntityBaseParameters, self).__init__(**kwargs) self.state = state @@ -18139,11 +18175,11 @@ class UserContractProperties(UserEntityBaseParameters): unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :vartype state: str or ~api_management_client.models.UserState + :vartype state: str or ~azure.mgmt.apimanagement.models.UserState :ivar note: Optional note about a user set by the administrator. :vartype note: str :ivar identities: Collection of user identities. - :vartype identities: list[~api_management_client.models.UserIdentityContract] + :vartype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :ivar first_name: First name. :vartype first_name: str :ivar last_name: Last name. @@ -18154,7 +18190,7 @@ class UserContractProperties(UserEntityBaseParameters): ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. :vartype registration_date: ~datetime.datetime :ivar groups: Collection of groups user is part of. - :vartype groups: list[~api_management_client.models.GroupContractProperties] + :vartype groups: list[~azure.mgmt.apimanagement.models.GroupContractProperties] """ _validation = { @@ -18189,11 +18225,11 @@ def __init__( unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :paramtype state: str or ~api_management_client.models.UserState + :paramtype state: str or ~azure.mgmt.apimanagement.models.UserState :keyword note: Optional note about a user set by the administrator. :paramtype note: str :keyword identities: Collection of user identities. - :paramtype identities: list[~api_management_client.models.UserIdentityContract] + :paramtype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :keyword first_name: First name. :paramtype first_name: str :keyword last_name: Last name. @@ -18221,11 +18257,11 @@ class UserCreateParameterProperties(UserEntityBaseParameters): unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :vartype state: str or ~api_management_client.models.UserState + :vartype state: str or ~azure.mgmt.apimanagement.models.UserState :ivar note: Optional note about a user set by the administrator. :vartype note: str :ivar identities: Collection of user identities. - :vartype identities: list[~api_management_client.models.UserIdentityContract] + :vartype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :ivar email: Required. Email address. Must not be empty and must be unique within the service instance. :vartype email: str @@ -18237,10 +18273,10 @@ class UserCreateParameterProperties(UserEntityBaseParameters): :vartype password: str :ivar app_type: Determines the type of application which send the create user request. Default is legacy portal. Possible values include: "portal", "developerPortal". - :vartype app_type: str or ~api_management_client.models.AppType + :vartype app_type: str or ~azure.mgmt.apimanagement.models.AppType :ivar confirmation: Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: "signup", "invite". - :vartype confirmation: str or ~api_management_client.models.Confirmation + :vartype confirmation: str or ~azure.mgmt.apimanagement.models.Confirmation """ _validation = { @@ -18280,11 +18316,11 @@ def __init__( unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :paramtype state: str or ~api_management_client.models.UserState + :paramtype state: str or ~azure.mgmt.apimanagement.models.UserState :keyword note: Optional note about a user set by the administrator. :paramtype note: str :keyword identities: Collection of user identities. - :paramtype identities: list[~api_management_client.models.UserIdentityContract] + :paramtype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :keyword email: Required. Email address. Must not be empty and must be unique within the service instance. :paramtype email: str @@ -18296,10 +18332,10 @@ def __init__( :paramtype password: str :keyword app_type: Determines the type of application which send the create user request. Default is legacy portal. Possible values include: "portal", "developerPortal". - :paramtype app_type: str or ~api_management_client.models.AppType + :paramtype app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword confirmation: Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: "signup", "invite". - :paramtype confirmation: str or ~api_management_client.models.Confirmation + :paramtype confirmation: str or ~azure.mgmt.apimanagement.models.Confirmation """ super(UserCreateParameterProperties, self).__init__(state=state, note=note, identities=identities, **kwargs) self.email = email @@ -18317,11 +18353,11 @@ class UserCreateParameters(msrest.serialization.Model): unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :vartype state: str or ~api_management_client.models.UserState + :vartype state: str or ~azure.mgmt.apimanagement.models.UserState :ivar note: Optional note about a user set by the administrator. :vartype note: str :ivar identities: Collection of user identities. - :vartype identities: list[~api_management_client.models.UserIdentityContract] + :vartype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :ivar email: Email address. Must not be empty and must be unique within the service instance. :vartype email: str :ivar first_name: First name. @@ -18332,10 +18368,10 @@ class UserCreateParameters(msrest.serialization.Model): :vartype password: str :ivar app_type: Determines the type of application which send the create user request. Default is legacy portal. Possible values include: "portal", "developerPortal". - :vartype app_type: str or ~api_management_client.models.AppType + :vartype app_type: str or ~azure.mgmt.apimanagement.models.AppType :ivar confirmation: Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: "signup", "invite". - :vartype confirmation: str or ~api_management_client.models.Confirmation + :vartype confirmation: str or ~azure.mgmt.apimanagement.models.Confirmation """ _validation = { @@ -18375,11 +18411,11 @@ def __init__( unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :paramtype state: str or ~api_management_client.models.UserState + :paramtype state: str or ~azure.mgmt.apimanagement.models.UserState :keyword note: Optional note about a user set by the administrator. :paramtype note: str :keyword identities: Collection of user identities. - :paramtype identities: list[~api_management_client.models.UserIdentityContract] + :paramtype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :keyword email: Email address. Must not be empty and must be unique within the service instance. :paramtype email: str @@ -18391,10 +18427,10 @@ def __init__( :paramtype password: str :keyword app_type: Determines the type of application which send the create user request. Default is legacy portal. Possible values include: "portal", "developerPortal". - :paramtype app_type: str or ~api_management_client.models.AppType + :paramtype app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword confirmation: Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: "signup", "invite". - :paramtype confirmation: str or ~api_management_client.models.Confirmation + :paramtype confirmation: str or ~azure.mgmt.apimanagement.models.Confirmation """ super(UserCreateParameters, self).__init__(**kwargs) self.state = state @@ -18412,7 +18448,7 @@ class UserIdentityCollection(msrest.serialization.Model): """List of Users Identity list representation. :ivar value: User Identity values. - :vartype value: list[~api_management_client.models.UserIdentityContract] + :vartype value: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :ivar count: Total record count number across all pages. :vartype count: long :ivar next_link: Next page link if any. @@ -18435,7 +18471,7 @@ def __init__( ): """ :keyword value: User Identity values. - :paramtype value: list[~api_management_client.models.UserIdentityContract] + :paramtype value: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :keyword count: Total record count number across all pages. :paramtype count: long :keyword next_link: Next page link if any. @@ -18516,7 +18552,7 @@ class UserTokenParameters(msrest.serialization.Model): :ivar key_type: The Key to be used to generate token for user. Possible values include: "primary", "secondary". - :vartype key_type: str or ~api_management_client.models.KeyType + :vartype key_type: str or ~azure.mgmt.apimanagement.models.KeyType :ivar expiry: The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. @@ -18538,7 +18574,7 @@ def __init__( """ :keyword key_type: The Key to be used to generate token for user. Possible values include: "primary", "secondary". - :paramtype key_type: str or ~api_management_client.models.KeyType + :paramtype key_type: str or ~azure.mgmt.apimanagement.models.KeyType :keyword expiry: The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: ``yyyy-MM-ddTHH:mm:ssZ`` as specified by the ISO 8601 standard. @@ -18581,11 +18617,11 @@ class UserUpdateParameters(msrest.serialization.Model): unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :vartype state: str or ~api_management_client.models.UserState + :vartype state: str or ~azure.mgmt.apimanagement.models.UserState :ivar note: Optional note about a user set by the administrator. :vartype note: str :ivar identities: Collection of user identities. - :vartype identities: list[~api_management_client.models.UserIdentityContract] + :vartype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :ivar email: Email address. Must not be empty and must be unique within the service instance. :vartype email: str :ivar password: User Password. @@ -18629,11 +18665,11 @@ def __init__( unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :paramtype state: str or ~api_management_client.models.UserState + :paramtype state: str or ~azure.mgmt.apimanagement.models.UserState :keyword note: Optional note about a user set by the administrator. :paramtype note: str :keyword identities: Collection of user identities. - :paramtype identities: list[~api_management_client.models.UserIdentityContract] + :paramtype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :keyword email: Email address. Must not be empty and must be unique within the service instance. :paramtype email: str @@ -18661,11 +18697,11 @@ class UserUpdateParametersProperties(UserEntityBaseParameters): unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :vartype state: str or ~api_management_client.models.UserState + :vartype state: str or ~azure.mgmt.apimanagement.models.UserState :ivar note: Optional note about a user set by the administrator. :vartype note: str :ivar identities: Collection of user identities. - :vartype identities: list[~api_management_client.models.UserIdentityContract] + :vartype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :ivar email: Email address. Must not be empty and must be unique within the service instance. :vartype email: str :ivar password: User Password. @@ -18709,11 +18745,11 @@ def __init__( unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: "active", "blocked", "pending", "deleted". Default value: "active". - :paramtype state: str or ~api_management_client.models.UserState + :paramtype state: str or ~azure.mgmt.apimanagement.models.UserState :keyword note: Optional note about a user set by the administrator. :paramtype note: str :keyword identities: Collection of user identities. - :paramtype identities: list[~api_management_client.models.UserIdentityContract] + :paramtype identities: list[~azure.mgmt.apimanagement.models.UserIdentityContract] :keyword email: Email address. Must not be empty and must be unique within the service instance. :paramtype email: str 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 3dd52b858228..e710d7f05ef6 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,10 +38,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -49,27 +50,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -94,21 +96,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -121,10 +123,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -133,21 +136,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,12 +167,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -178,25 +181,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -215,12 +218,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -229,24 +232,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -263,10 +266,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -275,22 +279,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -301,7 +305,7 @@ class ApiDiagnosticOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -337,18 +341,21 @@ def list_by_service( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DiagnosticCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.DiagnosticCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.DiagnosticCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -362,6 +369,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -377,6 +385,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -397,7 +406,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -411,7 +424,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics"} # type: ignore @distributed_trace def get_entity_tag( @@ -444,6 +457,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -451,12 +466,17 @@ def get_entity_tag( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -472,7 +492,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace @@ -497,7 +517,7 @@ def get( :type diagnostic_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -506,6 +526,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -513,12 +535,17 @@ def get( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -536,7 +563,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace @@ -562,13 +589,13 @@ def create_or_update( service instance. :type diagnostic_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -577,6 +604,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -587,6 +615,7 @@ def create_or_update( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -595,7 +624,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -619,7 +652,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace @@ -648,10 +681,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Diagnostic Update parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -660,6 +693,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -670,6 +704,7 @@ def update( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -678,7 +713,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -696,11 +735,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -734,6 +773,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -741,13 +782,18 @@ def delete( api_id=api_id, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -758,5 +804,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}"} # type: ignore 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 a357e2989249..b2225e1573bd 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,10 +35,11 @@ def build_get_request( export: Union[str, "_models.ExportApi"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -46,23 +47,23 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['format'] = _SERIALIZER.query("format", format, 'str') - query_parameters['export'] = _SERIALIZER.query("export", export, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['format'] = _SERIALIZER.query("format", format, 'str') + _query_parameters['export'] = _SERIALIZER.query("export", export, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -73,7 +74,7 @@ class ApiExportOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -110,12 +111,12 @@ def get( :type api_id: str :param format: Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. - :type format: str or ~api_management_client.models.ExportFormat + :type format: str or ~azure.mgmt.apimanagement.models.ExportFormat :param export: Query parameter required to export the API details. - :type export: str or ~api_management_client.models.ExportApi + :type export: str or ~azure.mgmt.apimanagement.models.ExportApi :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiExportResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiExportResult + :rtype: ~azure.mgmt.apimanagement.models.ApiExportResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiExportResult"] @@ -124,12 +125,15 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, export=export, template_url=self.get.metadata['url'], @@ -137,7 +141,11 @@ def get( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -152,5 +160,5 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore 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 a8fd53b22ce0..0ca52eb74ab1 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,10 +39,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -51,27 +52,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,10 +86,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -98,21 +100,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -126,10 +128,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -139,21 +142,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -171,12 +174,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -186,25 +189,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -222,10 +225,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -235,22 +239,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -261,7 +265,7 @@ class ApiIssueAttachmentOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -302,18 +306,22 @@ def list_by_service( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueAttachmentCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.IssueAttachmentCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.IssueAttachmentCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueAttachmentCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -328,6 +336,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -344,6 +353,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -364,7 +374,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -378,7 +392,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments"} # type: ignore @distributed_trace def get_entity_tag( @@ -416,6 +430,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -424,12 +440,17 @@ def get_entity_tag( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -445,7 +466,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore @distributed_trace @@ -474,7 +495,7 @@ def get( :type attachment_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueAttachmentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueAttachmentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueAttachmentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueAttachmentContract"] @@ -483,6 +504,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -491,12 +514,17 @@ def get( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -514,7 +542,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore @distributed_trace @@ -544,13 +572,13 @@ def create_or_update( Issue. :type attachment_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IssueAttachmentContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueAttachmentContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueAttachmentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueAttachmentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueAttachmentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueAttachmentContract"] @@ -559,6 +587,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueAttachmentContract') @@ -570,6 +599,7 @@ def create_or_update( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -578,7 +608,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -602,11 +636,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -644,6 +678,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -652,13 +688,18 @@ def delete( issue_id=issue_id, attachment_id=attachment_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -669,5 +710,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/attachments/{attachmentId}"} # type: ignore 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 2501492d6070..91205ae85b1d 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,10 +39,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -51,27 +52,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,10 +86,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -98,21 +100,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -126,10 +128,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -139,21 +142,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -171,12 +174,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -186,25 +189,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -222,10 +225,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -235,22 +239,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -261,7 +265,7 @@ class ApiIssueCommentOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -302,18 +306,21 @@ def list_by_service( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueCommentCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.IssueCommentCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.IssueCommentCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCommentCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -328,6 +335,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -344,6 +352,7 @@ def prepare_request(next_link=None): api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -364,7 +373,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -378,7 +391,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments"} # type: ignore @distributed_trace def get_entity_tag( @@ -415,6 +428,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -423,12 +438,17 @@ def get_entity_tag( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -444,7 +464,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore @distributed_trace @@ -472,7 +492,7 @@ def get( :type comment_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueCommentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueCommentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueCommentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCommentContract"] @@ -481,6 +501,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -489,12 +511,17 @@ def get( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -512,7 +539,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore @distributed_trace @@ -541,13 +568,13 @@ def create_or_update( :param comment_id: Comment identifier within an Issue. Must be unique in the current Issue. :type comment_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IssueCommentContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueCommentContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueCommentContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueCommentContract + :rtype: ~azure.mgmt.apimanagement.models.IssueCommentContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCommentContract"] @@ -556,6 +583,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueCommentContract') @@ -567,6 +595,7 @@ def create_or_update( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -575,7 +604,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -599,11 +632,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -640,6 +673,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -648,13 +683,18 @@ def delete( issue_id=issue_id, comment_id=comment_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -665,5 +705,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}/comments/{commentId}"} # type: ignore 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 f6344b38055a..79f52d3d5ba1 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,10 +39,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -50,29 +51,29 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if expand_comments_attachments is not None: - query_parameters['expandCommentsAttachments'] = _SERIALIZER.query("expand_comments_attachments", expand_comments_attachments, 'bool') + _query_parameters['expandCommentsAttachments'] = _SERIALIZER.query("expand_comments_attachments", expand_comments_attachments, 'bool') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,10 +86,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -97,21 +99,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -126,10 +128,11 @@ def build_get_request( expand_comments_attachments: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -138,23 +141,23 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if expand_comments_attachments is not None: - query_parameters['expandCommentsAttachments'] = _SERIALIZER.query("expand_comments_attachments", expand_comments_attachments, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['expandCommentsAttachments'] = _SERIALIZER.query("expand_comments_attachments", expand_comments_attachments, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -171,12 +174,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -185,25 +188,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -222,12 +225,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -236,24 +239,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -270,10 +273,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -282,22 +286,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -308,7 +312,7 @@ class ApiIssueOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -347,19 +351,21 @@ def list_by_service( 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 | |
. + filter | eq | |
. Default value is None. :type filter: str - :param expand_comments_attachments: Expand the comment attachments. + :param expand_comments_attachments: Expand the comment attachments. Default value is None. :type expand_comments_attachments: bool - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.IssueCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.IssueCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -373,6 +379,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, expand_comments_attachments=expand_comments_attachments, top=top, @@ -389,6 +396,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, expand_comments_attachments=expand_comments_attachments, top=top, @@ -410,7 +418,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -424,7 +436,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues"} # type: ignore @distributed_trace def get_entity_tag( @@ -457,6 +469,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -464,12 +478,17 @@ def get_entity_tag( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -485,7 +504,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace @@ -509,11 +528,11 @@ def get( :param issue_id: Issue identifier. Must be unique in the current API Management service instance. :type issue_id: str - :param expand_comments_attachments: Expand the comment attachments. + :param expand_comments_attachments: Expand the comment attachments. Default value is None. :type expand_comments_attachments: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -522,6 +541,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -529,13 +550,18 @@ def get( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, expand_comments_attachments=expand_comments_attachments, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -553,7 +579,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace @@ -579,13 +605,13 @@ def create_or_update( instance. :type issue_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IssueContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -594,6 +620,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueContract') @@ -604,6 +631,7 @@ def create_or_update( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -612,7 +640,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -636,7 +668,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace @@ -665,10 +697,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.IssueUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.IssueUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -677,6 +709,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IssueUpdateContract') @@ -687,6 +720,7 @@ def update( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -695,7 +729,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -713,11 +751,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -751,6 +789,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -758,13 +798,18 @@ def delete( api_id=api_id, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -775,5 +820,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_client_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_client_operations.py index cd244845fc93..9812868948cc 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_client_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_client_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -17,7 +18,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,35 +37,35 @@ def build_perform_connectivity_check_async_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -86,6 +86,7 @@ def _perform_connectivity_check_async_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(connectivity_check_request_params, 'ConnectivityCheckRequest') @@ -94,6 +95,7 @@ def _perform_connectivity_check_async_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._perform_connectivity_check_async_initial.metadata['url'], @@ -101,7 +103,11 @@ def _perform_connectivity_check_async_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -117,7 +123,7 @@ def _perform_connectivity_check_async_initial( return deserialized - _perform_connectivity_check_async_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck'} # type: ignore + _perform_connectivity_check_async_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck"} # type: ignore @distributed_trace @@ -136,7 +142,8 @@ def begin_perform_connectivity_check_async( :param service_name: The name of the API Management service. :type service_name: str :param connectivity_check_request_params: Connectivity Check request parameters. - :type connectivity_check_request_params: ~api_management_client.models.ConnectivityCheckRequest + :type connectivity_check_request_params: + ~azure.mgmt.apimanagement.models.ConnectivityCheckRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -147,11 +154,13 @@ def begin_perform_connectivity_check_async( Retry-After header is present. :return: An instance of LROPoller that returns either ConnectivityCheckResponse or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.ConnectivityCheckResponse] + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ConnectivityCheckResponse] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectivityCheckResponse"] lro_delay = kwargs.pop( 'polling_interval', @@ -163,6 +172,7 @@ def begin_perform_connectivity_check_async( resource_group_name=resource_group_name, service_name=service_name, connectivity_check_request_params=connectivity_check_request_params, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -187,7 +197,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_perform_connectivity_check_async.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck'} # type: ignore + begin_perform_connectivity_check_async.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py index 5777a7c231cd..5fcba90656ff 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_operations_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request @@ -29,24 +29,25 @@ def build_list_request( **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/providers/Microsoft.ApiManagement/operations') + _url = kwargs.pop("template_url", "/providers/Microsoft.ApiManagement/operations") # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -57,7 +58,7 @@ class ApiManagementOperationsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -81,9 +82,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.OperationListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.OperationListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -93,6 +96,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -101,6 +105,7 @@ def prepare_request(next_link=None): else: request = build_list_request( + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -118,7 +123,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -132,4 +141,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/providers/Microsoft.ApiManagement/operations'} # type: ignore + list.metadata = {'url': "/providers/Microsoft.ApiManagement/operations"} # type: ignore 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 962b9e7ce1e8..f5adfb76cd2e 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,35 +38,35 @@ def build_restore_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -82,35 +82,35 @@ def build_backup_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -126,35 +126,35 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -170,35 +170,35 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -211,31 +211,32 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -246,31 +247,32 @@ def build_delete_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -280,30 +282,31 @@ def build_list_by_resource_group_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -312,29 +315,30 @@ def build_list_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service") path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -345,31 +349,32 @@ def build_get_sso_token_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -381,33 +386,33 @@ def build_check_name_availability_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -418,29 +423,30 @@ def build_get_domain_ownership_identifier_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -454,35 +460,35 @@ def build_apply_network_configuration_updates_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -495,7 +501,7 @@ class ApiManagementServiceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -523,6 +529,7 @@ def _restore_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceBackupRestoreParameters') @@ -531,6 +538,7 @@ def _restore_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._restore_initial.metadata['url'], @@ -538,7 +546,11 @@ def _restore_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -554,7 +566,7 @@ def _restore_initial( return deserialized - _restore_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore'} # type: ignore + _restore_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore"} # type: ignore @distributed_trace @@ -575,7 +587,7 @@ def begin_restore( :type service_name: str :param parameters: Parameters supplied to the Restore API Management service from backup operation. - :type parameters: ~api_management_client.models.ApiManagementServiceBackupRestoreParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceBackupRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -587,11 +599,12 @@ def begin_restore( :return: An instance of LROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -603,6 +616,7 @@ def begin_restore( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -627,10 +641,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_restore.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore'} # type: ignore + begin_restore.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/restore"} # type: ignore def _backup_initial( self, @@ -645,6 +658,7 @@ def _backup_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceBackupRestoreParameters') @@ -653,6 +667,7 @@ def _backup_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._backup_initial.metadata['url'], @@ -660,7 +675,11 @@ def _backup_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -676,7 +695,7 @@ def _backup_initial( return deserialized - _backup_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup'} # type: ignore + _backup_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup"} # type: ignore @distributed_trace @@ -695,7 +714,7 @@ def begin_backup( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Parameters supplied to the ApiManagementService_Backup operation. - :type parameters: ~api_management_client.models.ApiManagementServiceBackupRestoreParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceBackupRestoreParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -707,11 +726,12 @@ def begin_backup( :return: An instance of LROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -723,6 +743,7 @@ def begin_backup( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -747,10 +768,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_backup.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup'} # type: ignore + begin_backup.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backup"} # type: ignore def _create_or_update_initial( self, @@ -765,6 +785,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceResource') @@ -773,6 +794,7 @@ def _create_or_update_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -780,7 +802,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -799,7 +825,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace @@ -818,7 +844,7 @@ def begin_create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Parameters supplied to the CreateOrUpdate API Management service operation. - :type parameters: ~api_management_client.models.ApiManagementServiceResource + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -830,11 +856,12 @@ def begin_create_or_update( :return: An instance of LROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -846,6 +873,7 @@ def begin_create_or_update( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -870,10 +898,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore def _update_initial( self, @@ -888,6 +915,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceUpdateParameters') @@ -896,6 +924,7 @@ def _update_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._update_initial.metadata['url'], @@ -903,7 +932,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -919,7 +952,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace @@ -937,7 +970,7 @@ def begin_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Parameters supplied to the CreateOrUpdate API Management service operation. - :type parameters: ~api_management_client.models.ApiManagementServiceUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiManagementServiceUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -949,11 +982,12 @@ def begin_update( :return: An instance of LROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -965,6 +999,7 @@ def begin_update( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -989,10 +1024,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace def get( @@ -1009,7 +1043,7 @@ def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceResource, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceResource + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] @@ -1018,17 +1052,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1043,7 +1084,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore def _delete_initial( @@ -1058,17 +1099,24 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -1084,7 +1132,7 @@ def _delete_initial( return deserialized - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace @@ -1111,10 +1159,11 @@ def begin_delete( :return: An instance of LROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -1125,6 +1174,7 @@ def begin_delete( raw_result = self._delete_initial( resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1148,10 +1198,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}"} # type: ignore @distributed_trace def list_by_resource_group( @@ -1167,9 +1216,11 @@ def list_by_resource_group( :return: An iterator like instance of either ApiManagementServiceListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~api_management_client.models.ApiManagementServiceListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiManagementServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1181,6 +1232,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_resource_group.metadata['url'], ) request = _convert_request(request) @@ -1191,6 +1243,7 @@ def prepare_request(next_link=None): request = build_list_by_resource_group_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1208,7 +1261,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1222,7 +1279,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service'} # type: ignore + list_by_resource_group.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service"} # type: ignore @distributed_trace def list( @@ -1235,9 +1292,11 @@ def list( :return: An iterator like instance of either ApiManagementServiceListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~api_management_client.models.ApiManagementServiceListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiManagementServiceListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1248,6 +1307,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -1257,6 +1317,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -1274,7 +1335,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1288,7 +1353,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/service"} # type: ignore @distributed_trace def get_sso_token( @@ -1305,7 +1370,7 @@ def get_sso_token( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceGetSsoTokenResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceGetSsoTokenResult + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceGetSsoTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceGetSsoTokenResult"] @@ -1314,17 +1379,24 @@ def get_sso_token( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_sso_token_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_sso_token.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1339,7 +1411,7 @@ def get_sso_token( return deserialized - get_sso_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken'} # type: ignore + get_sso_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/getssotoken"} # type: ignore @distributed_trace @@ -1352,10 +1424,10 @@ def check_name_availability( :param parameters: Parameters supplied to the CheckNameAvailability operation. :type parameters: - ~api_management_client.models.ApiManagementServiceCheckNameAvailabilityParameters + ~azure.mgmt.apimanagement.models.ApiManagementServiceCheckNameAvailabilityParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceNameAvailabilityResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceNameAvailabilityResult + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceNameAvailabilityResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceNameAvailabilityResult"] @@ -1364,12 +1436,14 @@ def check_name_availability( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiManagementServiceCheckNameAvailabilityParameters') request = build_check_name_availability_request( subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.check_name_availability.metadata['url'], @@ -1377,7 +1451,11 @@ def check_name_availability( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1392,7 +1470,7 @@ def check_name_availability( return deserialized - check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability'} # type: ignore + check_name_availability.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/checkNameAvailability"} # type: ignore @distributed_trace @@ -1404,7 +1482,7 @@ def get_domain_ownership_identifier( :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiManagementServiceGetDomainOwnershipIdentifierResult, or the result of cls(response) - :rtype: ~api_management_client.models.ApiManagementServiceGetDomainOwnershipIdentifierResult + :rtype: ~azure.mgmt.apimanagement.models.ApiManagementServiceGetDomainOwnershipIdentifierResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceGetDomainOwnershipIdentifierResult"] @@ -1413,15 +1491,22 @@ def get_domain_ownership_identifier( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_domain_ownership_identifier_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_domain_ownership_identifier.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1436,7 +1521,7 @@ def get_domain_ownership_identifier( return deserialized - get_domain_ownership_identifier.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier'} # type: ignore + get_domain_ownership_identifier.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/getDomainOwnershipIdentifier"} # type: ignore def _apply_network_configuration_updates_initial( @@ -1452,6 +1537,7 @@ def _apply_network_configuration_updates_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if parameters is not None: @@ -1463,6 +1549,7 @@ def _apply_network_configuration_updates_initial( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._apply_network_configuration_updates_initial.metadata['url'], @@ -1470,7 +1557,11 @@ def _apply_network_configuration_updates_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1486,7 +1577,7 @@ def _apply_network_configuration_updates_initial( return deserialized - _apply_network_configuration_updates_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates'} # type: ignore + _apply_network_configuration_updates_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates"} # type: ignore @distributed_trace @@ -1506,9 +1597,9 @@ def begin_apply_network_configuration_updates( :type service_name: str :param parameters: Parameters supplied to the Apply Network Configuration operation. If the parameters are empty, all the regions in which the Api Management service is deployed will be - updated sequentially without incurring downtime in the region. + updated sequentially without incurring downtime in the region. Default value is None. :type parameters: - ~api_management_client.models.ApiManagementServiceApplyNetworkConfigurationParameters + ~azure.mgmt.apimanagement.models.ApiManagementServiceApplyNetworkConfigurationParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -1520,11 +1611,12 @@ def begin_apply_network_configuration_updates( :return: An instance of LROPoller that returns either ApiManagementServiceResource or the result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~api_management_client.models.ApiManagementServiceResource] + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ApiManagementServiceResource] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementServiceResource"] lro_delay = kwargs.pop( 'polling_interval', @@ -1536,6 +1628,7 @@ def begin_apply_network_configuration_updates( resource_group_name=resource_group_name, service_name=service_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -1560,7 +1653,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_apply_network_configuration_updates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates'} # type: ignore + begin_apply_network_configuration_updates.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/applynetworkconfigurationupdates"} # type: ignore 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 02c38580d51e..a0b0626e567d 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_list_available_service_skus_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -67,7 +68,7 @@ class ApiManagementServiceSkusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -99,9 +100,11 @@ def list_available_service_skus( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ResourceSkuResults or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ResourceSkuResults] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ResourceSkuResults] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ResourceSkuResults"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -114,6 +117,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_available_service_skus.metadata['url'], ) request = _convert_request(request) @@ -125,6 +129,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -142,7 +147,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -156,4 +165,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_available_service_skus.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus'} # type: ignore + list_available_service_skus.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/skus"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py index a41bb26691b6..ed08d113e16a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_management_skus_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -30,29 +30,30 @@ def build_list_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus") path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -63,7 +64,7 @@ class ApiManagementSkusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -88,9 +89,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiManagementSkusResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ApiManagementSkusResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiManagementSkusResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiManagementSkusResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -101,6 +104,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -110,6 +114,7 @@ def prepare_request(next_link=None): request = build_list_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -127,7 +132,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -141,4 +150,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/skus"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_operation_operations.py index 8f1aa1bc8117..2e8ed47e9987 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,10 +39,11 @@ def build_list_by_api_request( tags: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -50,29 +51,29 @@ def build_list_by_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,10 +86,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -97,21 +99,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -124,10 +126,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -136,21 +139,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -167,12 +170,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -181,25 +184,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -218,12 +221,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -232,24 +235,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -266,10 +269,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -278,22 +282,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -304,7 +308,7 @@ class ApiOperationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -347,19 +351,21 @@ def list_by_api( |
| 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 | filter | ge, le, eq, ne, gt, lt | substringof, contains, - startswith, endswith |
. + startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param tags: Include tags in the response. + :param tags: Include tags in the response. Default value is None. :type tags: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.OperationCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.OperationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -373,6 +379,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -389,6 +396,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -410,7 +418,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -424,7 +436,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations"} # type: ignore @distributed_trace def get_entity_tag( @@ -458,6 +470,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -465,12 +479,17 @@ def get_entity_tag( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -486,7 +505,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace @@ -512,7 +531,7 @@ def get( :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) - :rtype: ~api_management_client.models.OperationContract + :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] @@ -521,6 +540,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -528,12 +549,17 @@ def get( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -551,7 +577,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace @@ -578,13 +604,13 @@ def create_or_update( Management service instance. :type operation_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.OperationContract + :type parameters: ~azure.mgmt.apimanagement.models.OperationContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) - :rtype: ~api_management_client.models.OperationContract + :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] @@ -593,6 +619,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OperationContract') @@ -603,6 +630,7 @@ def create_or_update( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -611,7 +639,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -635,7 +667,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace @@ -665,10 +697,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: API Operation Update parameters. - :type parameters: ~api_management_client.models.OperationUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.OperationUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: OperationContract, or the result of cls(response) - :rtype: ~api_management_client.models.OperationContract + :rtype: ~azure.mgmt.apimanagement.models.OperationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationContract"] @@ -677,6 +709,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OperationUpdateContract') @@ -687,6 +720,7 @@ def update( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -695,7 +729,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -713,11 +751,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -752,6 +790,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -759,13 +799,18 @@ def delete( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -776,5 +821,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}"} # type: ignore 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 2cc176950b64..fc6f7bc01be1 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -34,10 +34,11 @@ def build_list_by_operation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -46,21 +47,21 @@ def build_list_by_operation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -74,10 +75,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -87,21 +89,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -117,10 +119,11 @@ def build_get_request( format: Optional[Union[str, "_models.PolicyExportFormat"]] = "xml", **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -130,23 +133,23 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if format is not None: - query_parameters['format'] = _SERIALIZER.query("format", format, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['format'] = _SERIALIZER.query("format", format, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,12 +167,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -179,25 +182,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -215,10 +218,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -228,22 +232,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -254,7 +258,7 @@ class ApiOperationPolicyOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -292,7 +296,7 @@ def list_by_operation( :type operation_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -301,6 +305,8 @@ def list_by_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_operation_request( resource_group_name=resource_group_name, @@ -308,12 +314,17 @@ def list_by_operation( api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -328,7 +339,7 @@ def list_by_operation( return deserialized - list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies'} # type: ignore + list_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies"} # type: ignore @distributed_trace @@ -354,7 +365,7 @@ def get_entity_tag( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -366,6 +377,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -374,12 +387,17 @@ def get_entity_tag( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -395,7 +413,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore @distributed_trace @@ -422,12 +440,12 @@ def get( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -436,6 +454,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -444,13 +464,18 @@ def get( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -468,7 +493,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore @distributed_trace @@ -496,15 +521,15 @@ def create_or_update( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -513,6 +538,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -524,6 +550,7 @@ def create_or_update( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -532,7 +559,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -556,11 +587,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -583,7 +614,7 @@ def delete( Management service instance. :type operation_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -598,6 +629,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -606,13 +639,18 @@ def delete( operation_id=operation_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -623,5 +661,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/policies/{policyId}"} # type: ignore 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 e82a954a2e59..3f5f6c429677 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -41,41 +41,42 @@ def build_list_by_service_request( expand_api_version_set: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') if expand_api_version_set is not None: - query_parameters['expandApiVersionSet'] = _SERIALIZER.query("expand_api_version_set", expand_api_version_set, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['expandApiVersionSet'] = _SERIALIZER.query("expand_api_version_set", expand_api_version_set, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -87,10 +88,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -98,21 +100,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -124,10 +126,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -135,21 +138,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -165,12 +168,12 @@ def build_create_or_update_request_initial( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -178,25 +181,25 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -214,12 +217,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -227,24 +230,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -261,10 +264,11 @@ def build_delete_request( delete_revisions: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -272,24 +276,24 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if delete_revisions is not None: - query_parameters['deleteRevisions'] = _SERIALIZER.query("delete_revisions", delete_revisions, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['deleteRevisions'] = _SERIALIZER.query("delete_revisions", delete_revisions, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -305,39 +309,40 @@ def build_list_by_tags_request( include_not_tagged_apis: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if include_not_tagged_apis is not None: - query_parameters['includeNotTaggedApis'] = _SERIALIZER.query("include_not_tagged_apis", include_not_tagged_apis, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['includeNotTaggedApis'] = _SERIALIZER.query("include_not_tagged_apis", include_not_tagged_apis, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -348,7 +353,7 @@ class ApiOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -388,21 +393,24 @@ def list_by_service( |
| 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 |
| isCurrent | filter | eq, ne | |
. + startswith, endswith |
| isCurrent | filter | eq, ne | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param tags: Include tags in the response. + :param tags: Include tags in the response. Default value is None. :type tags: str - :param expand_api_version_set: Include full ApiVersionSet resource in response. + :param expand_api_version_set: Include full ApiVersionSet resource in response. Default value + is None. :type expand_api_version_set: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ApiCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -415,6 +423,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -431,6 +440,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -453,7 +463,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -467,7 +481,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis"} # type: ignore @distributed_trace def get_entity_tag( @@ -497,18 +511,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -524,7 +545,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace @@ -546,7 +567,7 @@ def get( :type api_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -555,18 +576,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -584,7 +612,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore def _create_or_update_initial( @@ -602,6 +630,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiCreateOrUpdateParameter') @@ -611,6 +640,7 @@ def _create_or_update_initial( service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -619,7 +649,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -643,7 +677,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace @@ -666,9 +700,9 @@ def begin_create_or_update( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.ApiCreateOrUpdateParameter + :type parameters: ~azure.mgmt.apimanagement.models.ApiCreateOrUpdateParameter :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -680,11 +714,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either ApiContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.ApiContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.ApiContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -698,6 +733,7 @@ def begin_create_or_update( api_id=api_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -725,10 +761,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace def update( @@ -753,10 +788,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: API Update Contract parameters. - :type parameters: ~api_management_client.models.ApiUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -765,6 +800,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiUpdateContract') @@ -774,6 +810,7 @@ def update( service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -782,7 +819,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -800,11 +841,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -825,7 +866,7 @@ def delete( :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 delete_revisions: Delete all revisions of the Api. + :param delete_revisions: Delete all revisions of the Api. Default value is None. :type delete_revisions: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -838,12 +879,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, delete_revisions=delete_revisions, template_url=self.delete.metadata['url'], @@ -851,7 +895,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -862,7 +910,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}"} # type: ignore @distributed_trace @@ -890,20 +938,23 @@ def list_by_tags( 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 | |
. + contains, startswith, endswith |
| isCurrent | filter | eq | |
. Default value is + None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param include_not_tagged_apis: Include not tagged APIs. + :param include_not_tagged_apis: Include not tagged APIs. Default value is None. :type include_not_tagged_apis: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagResourceCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -916,6 +967,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -931,6 +983,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -952,7 +1005,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -966,4 +1023,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags'} # type: ignore + list_by_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apisByTags"} # type: ignore 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 e4d0598ec0d5..fe364d958886 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,10 +33,11 @@ def build_list_by_api_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -44,21 +45,21 @@ def build_list_by_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -71,10 +72,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -83,21 +85,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -112,10 +114,11 @@ def build_get_request( format: Optional[Union[str, "_models.PolicyExportFormat"]] = "xml", **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json, application/vnd.ms-azure-apim.policy+xml, application/vnd.ms-azure-apim.policy.raw+xml" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -124,23 +127,23 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if format is not None: - query_parameters['format'] = _SERIALIZER.query("format", format, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['format'] = _SERIALIZER.query("format", format, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -171,25 +174,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,10 +209,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -218,22 +222,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -244,7 +248,7 @@ class ApiPolicyOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -278,7 +282,7 @@ def list_by_api( :type api_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -287,18 +291,25 @@ def list_by_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_api_request( resource_group_name=resource_group_name, service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -313,7 +324,7 @@ def list_by_api( return deserialized - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies"} # type: ignore @distributed_trace @@ -335,7 +346,7 @@ def get_entity_tag( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -347,6 +358,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -354,12 +367,17 @@ def get_entity_tag( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -375,7 +393,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore @distributed_trace @@ -398,12 +416,12 @@ def get( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -412,6 +430,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -419,13 +439,18 @@ def get( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 200]: @@ -449,7 +474,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore @distributed_trace @@ -473,15 +498,15 @@ def create_or_update( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -490,6 +515,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -500,6 +526,7 @@ def create_or_update( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -508,7 +535,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -532,11 +563,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -555,7 +586,7 @@ def delete( instance. Non-current revision has ;rev=n as a suffix where n is the revision number. :type api_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -570,6 +601,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -577,13 +610,18 @@ def delete( api_id=api_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -594,5 +632,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/policies/{policyId}"} # type: ignore 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 e3f4abe61ecd..6ea232c94d9a 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_by_apis_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_by_apis_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,7 +80,7 @@ class ApiProductOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -115,17 +116,20 @@ def list_by_apis( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| displayName - | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ProductCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ProductCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -139,6 +143,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -154,6 +159,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -174,7 +180,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -188,4 +198,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_apis.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products'} # type: ignore + list_by_apis.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/products"} # type: ignore 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 e75d1fab92dc..91bb35c441f6 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,10 +38,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -49,27 +50,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -94,21 +96,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -121,10 +123,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -133,21 +136,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,12 +167,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -178,25 +181,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -215,12 +218,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -229,24 +232,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -263,10 +266,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -275,22 +279,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -301,7 +305,7 @@ class ApiReleaseOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -339,18 +343,21 @@ def list_by_service( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| notes | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiReleaseCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ApiReleaseCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiReleaseCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -364,6 +371,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -379,6 +387,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -399,7 +408,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -413,7 +426,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases"} # type: ignore @distributed_trace def get_entity_tag( @@ -446,6 +459,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -453,12 +468,17 @@ def get_entity_tag( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -474,7 +494,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace @@ -499,7 +519,7 @@ def get( :type release_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiReleaseContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiReleaseContract + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseContract"] @@ -508,6 +528,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -515,12 +537,17 @@ def get( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -538,7 +565,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace @@ -564,13 +591,13 @@ def create_or_update( Management service instance. :type release_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.ApiReleaseContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiReleaseContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiReleaseContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiReleaseContract + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseContract"] @@ -579,6 +606,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiReleaseContract') @@ -589,6 +617,7 @@ def create_or_update( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -597,7 +626,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -621,7 +654,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace @@ -650,10 +683,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: API Release Update parameters. - :type parameters: ~api_management_client.models.ApiReleaseContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiReleaseContract :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiReleaseContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiReleaseContract + :rtype: ~azure.mgmt.apimanagement.models.ApiReleaseContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiReleaseContract"] @@ -662,6 +695,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiReleaseContract') @@ -672,6 +706,7 @@ def update( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -680,7 +715,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -698,11 +737,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -736,6 +775,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -743,13 +784,18 @@ def delete( api_id=api_id, release_id=release_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -760,5 +806,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}"} # type: ignore 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 0b97f0eb64af..23ba158e2658 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,7 +80,7 @@ class ApiRevisionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -115,18 +116,21 @@ def list_by_service( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| apiRevision - | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiRevisionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ApiRevisionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiRevisionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiRevisionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -140,6 +144,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -155,6 +160,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -175,7 +181,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -189,4 +199,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/revisions"} # type: ignore 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 7a9726679060..182976268530 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -40,10 +40,11 @@ def build_list_by_api_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -51,27 +52,27 @@ def build_list_by_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -84,10 +85,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -96,21 +98,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -123,10 +125,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -135,21 +138,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -166,12 +169,12 @@ def build_create_or_update_request_initial( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -180,25 +183,25 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -216,10 +219,11 @@ def build_delete_request( force: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -228,24 +232,24 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if force is not None: - query_parameters['force'] = _SERIALIZER.query("force", force, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['force'] = _SERIALIZER.query("force", force, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -256,7 +260,7 @@ class ApiSchemaOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -293,17 +297,20 @@ def list_by_api( :type api_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| contentType - | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SchemaCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.SchemaCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.SchemaCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SchemaCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -317,6 +324,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -332,6 +340,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -352,7 +361,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -366,7 +379,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas"} # type: ignore @distributed_trace def get_entity_tag( @@ -400,6 +413,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -407,12 +422,17 @@ def get_entity_tag( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -428,7 +448,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore @distributed_trace @@ -454,7 +474,7 @@ def get( :type schema_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SchemaContract, or the result of cls(response) - :rtype: ~api_management_client.models.SchemaContract + :rtype: ~azure.mgmt.apimanagement.models.SchemaContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SchemaContract"] @@ -463,6 +483,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -470,12 +492,17 @@ def get( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -493,7 +520,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore def _create_or_update_initial( @@ -512,6 +539,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SchemaContract') @@ -522,6 +550,7 @@ def _create_or_update_initial( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -530,7 +559,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -554,7 +587,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore @distributed_trace @@ -581,9 +614,9 @@ def begin_create_or_update( instance. :type schema_id: str :param parameters: The schema contents to apply. - :type parameters: ~api_management_client.models.SchemaContract + :type parameters: ~azure.mgmt.apimanagement.models.SchemaContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -595,11 +628,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either SchemaContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.SchemaContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.SchemaContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.SchemaContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -614,6 +648,7 @@ def begin_create_or_update( schema_id=schema_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -641,13 +676,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -672,7 +706,8 @@ def delete( :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 force: If true removes all references to the schema before deleting it. + :param force: If true removes all references to the schema before deleting it. Default value is + None. :type force: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -685,6 +720,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -692,6 +729,7 @@ def delete( api_id=api_id, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, force=force, template_url=self.delete.metadata['url'], @@ -699,7 +737,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -710,5 +752,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/schemas/{schemaId}"} # type: ignore 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 ff9dc3c66877..7f7c832d1f82 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,10 +38,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -49,27 +50,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -94,21 +96,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -121,10 +123,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -133,21 +136,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,12 +167,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -178,25 +181,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -213,10 +216,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -225,22 +229,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -251,7 +255,7 @@ class ApiTagDescriptionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -290,18 +294,21 @@ def list_by_service( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagDescriptionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagDescriptionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagDescriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagDescriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -315,6 +322,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -330,6 +338,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -350,7 +359,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -364,7 +377,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions"} # type: ignore @distributed_trace def get_entity_tag( @@ -398,6 +411,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -405,12 +420,17 @@ def get_entity_tag( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -426,7 +446,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore @distributed_trace @@ -452,7 +472,7 @@ def get( :type tag_description_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagDescriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagDescriptionContract + :rtype: ~azure.mgmt.apimanagement.models.TagDescriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagDescriptionContract"] @@ -461,6 +481,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -468,12 +490,17 @@ def get( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -491,7 +518,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore @distributed_trace @@ -518,13 +545,13 @@ def create_or_update( API/Tag association. Based on API and Tag names. :type tag_description_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.TagDescriptionCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.TagDescriptionCreateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagDescriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagDescriptionContract + :rtype: ~azure.mgmt.apimanagement.models.TagDescriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagDescriptionContract"] @@ -533,6 +560,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'TagDescriptionCreateParameters') @@ -543,6 +571,7 @@ def create_or_update( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -551,7 +580,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -575,11 +608,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -614,6 +647,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -621,13 +656,18 @@ def delete( api_id=api_id, tag_description_id=tag_description_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -638,5 +678,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}"} # type: ignore 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 f9c42747ca3f..e2db1f53bc1b 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -289,7 +293,7 @@ class ApiVersionSetOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -321,18 +325,21 @@ def list_by_service( :param service_name: The name of the API Management service. :type service_name: str :param filter: | Field | Usage | Supported operators | Supported - functions |
|-------------|-------------|-------------|-------------|
. + functions |
|-------------|-------------|-------------|-------------|
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiVersionSetCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ApiVersionSetCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiVersionSetCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -345,6 +352,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -359,6 +367,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -379,7 +388,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -393,7 +406,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets"} # type: ignore @distributed_trace def get_entity_tag( @@ -423,18 +436,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -450,7 +470,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace @@ -472,7 +492,7 @@ def get( :type version_set_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiVersionSetContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiVersionSetContract + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetContract"] @@ -481,18 +501,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -510,7 +537,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace @@ -533,13 +560,13 @@ def create_or_update( service instance. :type version_set_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.ApiVersionSetContract + :type parameters: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiVersionSetContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiVersionSetContract + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetContract"] @@ -548,6 +575,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiVersionSetContract') @@ -557,6 +585,7 @@ def create_or_update( service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -565,7 +594,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -589,7 +622,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace @@ -615,10 +648,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.ApiVersionSetUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.ApiVersionSetUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiVersionSetContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiVersionSetContract + :rtype: ~azure.mgmt.apimanagement.models.ApiVersionSetContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiVersionSetContract"] @@ -627,6 +660,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ApiVersionSetUpdateParameters') @@ -636,6 +670,7 @@ def update( service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -644,7 +679,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -662,11 +701,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -697,19 +736,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, version_set_id=version_set_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -720,5 +766,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}"} # type: ignore 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 7a6bc20bd498..2e0aa52f38f0 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -290,10 +294,11 @@ def build_list_secrets_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -301,21 +306,21 @@ def build_list_secrets_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -326,7 +331,7 @@ class AuthorizationServerOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -361,19 +366,21 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AuthorizationServerCollection or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~api_management_client.models.AuthorizationServerCollection] + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.AuthorizationServerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -386,6 +393,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -400,6 +408,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -420,7 +429,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -434,7 +447,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers"} # type: ignore @distributed_trace def get_entity_tag( @@ -463,18 +476,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -490,7 +510,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace @@ -511,7 +531,7 @@ def get( :type authsid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerContract"] @@ -520,18 +540,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -549,7 +576,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace @@ -571,13 +598,13 @@ def create_or_update( :param authsid: Identifier of the authorization server. :type authsid: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.AuthorizationServerContract + :type parameters: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerContract"] @@ -586,6 +613,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AuthorizationServerContract') @@ -595,6 +623,7 @@ def create_or_update( service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -603,7 +632,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -627,7 +660,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace @@ -652,10 +685,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: OAuth2 Server settings Update parameters. - :type parameters: ~api_management_client.models.AuthorizationServerUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.AuthorizationServerUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerContract"] @@ -664,6 +697,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AuthorizationServerUpdateContract') @@ -673,6 +707,7 @@ def update( service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -681,7 +716,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -699,11 +738,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -733,19 +772,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -756,7 +802,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}"} # type: ignore @distributed_trace @@ -777,7 +823,7 @@ def list_secrets( :type authsid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AuthorizationServerSecretsContract, or the result of cls(response) - :rtype: ~api_management_client.models.AuthorizationServerSecretsContract + :rtype: ~azure.mgmt.apimanagement.models.AuthorizationServerSecretsContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AuthorizationServerSecretsContract"] @@ -786,18 +832,25 @@ def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, authsid=authsid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -815,5 +868,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets"} # type: ignore 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 3c0027e30913..ddbf8ce49010 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -293,12 +297,12 @@ def build_reconnect_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -306,23 +310,23 @@ def build_reconnect_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -335,7 +339,7 @@ class BackendOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -370,17 +374,20 @@ def list_by_service( 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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either BackendCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.BackendCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.BackendCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -393,6 +400,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -407,6 +415,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -427,7 +436,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -441,7 +454,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends"} # type: ignore @distributed_trace def get_entity_tag( @@ -471,18 +484,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -498,7 +518,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace @@ -520,7 +540,7 @@ def get( :type backend_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BackendContract, or the result of cls(response) - :rtype: ~api_management_client.models.BackendContract + :rtype: ~azure.mgmt.apimanagement.models.BackendContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendContract"] @@ -529,18 +549,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -558,7 +585,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace @@ -581,13 +608,13 @@ def create_or_update( Management service instance. :type backend_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.BackendContract + :type parameters: ~azure.mgmt.apimanagement.models.BackendContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: BackendContract, or the result of cls(response) - :rtype: ~api_management_client.models.BackendContract + :rtype: ~azure.mgmt.apimanagement.models.BackendContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendContract"] @@ -596,6 +623,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'BackendContract') @@ -605,6 +633,7 @@ def create_or_update( service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -613,7 +642,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -637,7 +670,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace @@ -663,10 +696,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.BackendUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.BackendUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: BackendContract, or the result of cls(response) - :rtype: ~api_management_client.models.BackendContract + :rtype: ~azure.mgmt.apimanagement.models.BackendContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.BackendContract"] @@ -675,6 +708,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'BackendUpdateParameters') @@ -684,6 +718,7 @@ def update( service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -692,7 +727,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -710,11 +749,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -745,19 +784,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -768,11 +814,11 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}"} # type: ignore @distributed_trace - def reconnect( + def reconnect( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -790,8 +836,8 @@ def reconnect( :param backend_id: Identifier of the Backend entity. Must be unique in the current API Management service instance. :type backend_id: str - :param parameters: Reconnect request parameters. - :type parameters: ~api_management_client.models.BackendReconnectContract + :param parameters: Reconnect request parameters. Default value is None. + :type parameters: ~azure.mgmt.apimanagement.models.BackendReconnectContract :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -803,6 +849,7 @@ def reconnect( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if parameters is not None: @@ -815,6 +862,7 @@ def reconnect( service_name=service_name, backend_id=backend_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.reconnect.metadata['url'], @@ -822,7 +870,11 @@ def reconnect( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [202]: @@ -833,5 +885,5 @@ def reconnect( if cls: return cls(pipeline_response, None, {}) - reconnect.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect'} # type: ignore + reconnect.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect"} # type: ignore 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 8d028e467c4b..98e47a726437 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -36,35 +36,36 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -76,10 +77,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -87,21 +89,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -113,10 +115,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -124,21 +127,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -154,12 +157,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -167,25 +170,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -203,12 +206,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -216,24 +219,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -249,10 +252,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -260,22 +264,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -286,7 +290,7 @@ class CacheOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -316,15 +320,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 top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CacheCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.CacheCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.CacheCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -337,6 +343,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=self.list_by_service.metadata['url'], @@ -350,6 +357,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=next_link, @@ -369,7 +377,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -383,7 +395,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches"} # type: ignore @distributed_trace def get_entity_tag( @@ -413,18 +425,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -440,7 +459,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace @@ -462,7 +481,7 @@ def get( :type cache_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CacheContract, or the result of cls(response) - :rtype: ~api_management_client.models.CacheContract + :rtype: ~azure.mgmt.apimanagement.models.CacheContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheContract"] @@ -471,18 +490,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -500,7 +526,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace @@ -523,13 +549,13 @@ def create_or_update( or valid Azure region identifier). :type cache_id: str :param parameters: Create or Update parameters. - :type parameters: ~api_management_client.models.CacheContract + :type parameters: ~azure.mgmt.apimanagement.models.CacheContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CacheContract, or the result of cls(response) - :rtype: ~api_management_client.models.CacheContract + :rtype: ~azure.mgmt.apimanagement.models.CacheContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheContract"] @@ -538,6 +564,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'CacheContract') @@ -547,6 +574,7 @@ def create_or_update( service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -555,7 +583,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -579,7 +611,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace @@ -605,10 +637,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.CacheUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.CacheUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: CacheContract, or the result of cls(response) - :rtype: ~api_management_client.models.CacheContract + :rtype: ~azure.mgmt.apimanagement.models.CacheContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CacheContract"] @@ -617,6 +649,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'CacheUpdateParameters') @@ -626,6 +659,7 @@ def update( service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -634,7 +668,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -652,11 +690,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -687,19 +725,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, cache_id=cache_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -710,5 +755,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}"} # type: ignore 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 988459941cfc..d0a57c11fcfd 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,39 +38,40 @@ def build_list_by_service_request( is_key_vault_refresh_failed: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if is_key_vault_refresh_failed is not None: - query_parameters['isKeyVaultRefreshFailed'] = _SERIALIZER.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['isKeyVaultRefreshFailed'] = _SERIALIZER.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -93,21 +95,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -119,10 +121,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -130,21 +133,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -160,12 +163,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -173,25 +176,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -207,10 +210,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -218,22 +222,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -245,10 +249,11 @@ def build_refresh_secret_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -256,21 +261,21 @@ def build_refresh_secret_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -281,7 +286,7 @@ class CertificateOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -318,21 +323,23 @@ def list_by_service( filter | ge, le, eq, ne, gt, lt | substringof, contains, 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 | |
. + |
| expirationDate | filter | ge, le, eq, ne, gt, lt | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :param is_key_vault_refresh_failed: When set to true, the response contains only certificates - entities which failed refresh. + entities which failed refresh. Default value is None. :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either CertificateCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.CertificateCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.CertificateCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -345,6 +352,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -360,6 +368,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -381,7 +390,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -395,7 +408,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates"} # type: ignore @distributed_trace def get_entity_tag( @@ -425,18 +438,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -452,7 +472,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace @@ -474,7 +494,7 @@ def get( :type certificate_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateContract, or the result of cls(response) - :rtype: ~api_management_client.models.CertificateContract + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] @@ -483,18 +503,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -512,7 +539,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace @@ -535,13 +562,13 @@ def create_or_update( Management service instance. :type certificate_id: str :param parameters: Create or Update parameters. - :type parameters: ~api_management_client.models.CertificateCreateOrUpdateParameters + :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateContract, or the result of cls(response) - :rtype: ~api_management_client.models.CertificateContract + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] @@ -550,6 +577,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'CertificateCreateOrUpdateParameters') @@ -559,6 +587,7 @@ def create_or_update( service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -567,7 +596,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -591,11 +624,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -626,19 +659,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -649,7 +689,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}"} # type: ignore @distributed_trace @@ -671,7 +711,7 @@ def refresh_secret( :type certificate_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: CertificateContract, or the result of cls(response) - :rtype: ~api_management_client.models.CertificateContract + :rtype: ~azure.mgmt.apimanagement.models.CertificateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.CertificateContract"] @@ -680,18 +720,25 @@ def refresh_secret( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_refresh_secret_request( resource_group_name=resource_group_name, service_name=service_name, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.refresh_secret.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -709,5 +756,5 @@ def refresh_secret( return deserialized - refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret'} # type: ignore + refresh_secret.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/certificates/{certificateId}/refreshSecret"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py index e637bf6033b1..d5f8ab44028a 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_item_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,10 +33,11 @@ def build_list_by_service_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -44,21 +45,21 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -71,10 +72,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -83,21 +85,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -110,10 +112,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -122,21 +125,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -151,10 +154,11 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -163,23 +167,23 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -194,10 +198,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -206,22 +211,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -232,7 +237,7 @@ class ContentItemOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -266,9 +271,11 @@ def list_by_service( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContentItemCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ContentItemCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ContentItemCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentItemCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -282,6 +289,7 @@ def prepare_request(next_link=None): service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -294,6 +302,7 @@ def prepare_request(next_link=None): service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -311,7 +320,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -325,7 +338,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems"} # type: ignore @distributed_trace def get_entity_tag( @@ -358,6 +371,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -365,12 +380,17 @@ def get_entity_tag( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -386,7 +406,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore @distributed_trace @@ -410,7 +430,7 @@ def get( :type content_item_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentItemContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentItemContract + :rtype: ~azure.mgmt.apimanagement.models.ContentItemContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentItemContract"] @@ -419,6 +439,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -426,12 +448,17 @@ def get( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -449,7 +476,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore @distributed_trace @@ -473,11 +500,11 @@ def create_or_update( :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentItemContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentItemContract + :rtype: ~azure.mgmt.apimanagement.models.ContentItemContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentItemContract"] @@ -486,6 +513,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -493,13 +522,18 @@ def create_or_update( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -523,11 +557,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -560,6 +594,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -567,13 +603,18 @@ def delete( content_type_id=content_type_id, content_item_id=content_item_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -584,5 +625,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py index ed923ccd8891..0b147791c1ef 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_content_type_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_list_by_service_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -68,10 +69,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -79,21 +81,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -107,10 +109,11 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -118,23 +121,23 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -148,10 +151,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -159,22 +163,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -185,7 +189,7 @@ class ContentTypeOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -217,9 +221,11 @@ def list_by_service( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ContentTypeCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ContentTypeCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ContentTypeCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentTypeCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -232,6 +238,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -243,6 +250,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -260,7 +268,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -274,7 +286,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes"} # type: ignore @distributed_trace def get( @@ -295,7 +307,7 @@ def get( :type content_type_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentTypeContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentTypeContract + :rtype: ~azure.mgmt.apimanagement.models.ContentTypeContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentTypeContract"] @@ -304,18 +316,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -333,7 +352,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}"} # type: ignore @distributed_trace @@ -356,11 +375,11 @@ def create_or_update( :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ContentTypeContract, or the result of cls(response) - :rtype: ~api_management_client.models.ContentTypeContract + :rtype: ~azure.mgmt.apimanagement.models.ContentTypeContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ContentTypeContract"] @@ -369,19 +388,26 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -405,11 +431,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -441,19 +467,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, content_type_id=content_type_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -464,5 +497,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}"} # type: ignore 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 9e76c7575dde..ce8b9b4009f7 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -67,31 +68,32 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -106,36 +108,36 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -152,37 +154,37 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -195,31 +197,32 @@ def build_list_secrets_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -230,7 +233,7 @@ class DelegationSettingsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -269,17 +272,24 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -295,7 +305,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace @@ -313,7 +323,7 @@ def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalDelegationSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalDelegationSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalDelegationSettings"] @@ -322,17 +332,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -350,11 +367,11 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace - def update( + def update( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -372,7 +389,7 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update Delegation settings. - :type parameters: ~api_management_client.models.PortalDelegationSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -384,6 +401,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalDelegationSettings') @@ -392,6 +410,7 @@ def update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -400,7 +419,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -411,7 +434,7 @@ def update( if cls: return cls(pipeline_response, None, {}) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace @@ -430,13 +453,13 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.PortalDelegationSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalDelegationSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalDelegationSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalDelegationSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalDelegationSettings"] @@ -445,6 +468,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalDelegationSettings') @@ -453,6 +477,7 @@ def create_or_update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -461,7 +486,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -476,7 +505,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation"} # type: ignore @distributed_trace @@ -494,7 +523,7 @@ def list_secrets( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSettingValidationKeyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSettingValidationKeyContract + :rtype: ~azure.mgmt.apimanagement.models.PortalSettingValidationKeyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSettingValidationKeyContract"] @@ -503,17 +532,24 @@ def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -528,5 +564,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py index 244b39f81a2f..a2cead551f4b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_deleted_services_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,29 +32,30 @@ def build_list_by_subscription_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices") path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -65,31 +66,32 @@ def build_get_by_name_request( location: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}") # pylint: disable=line-too-long path_format_arguments = { "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -100,31 +102,32 @@ def build_purge_request_initial( location: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}") # pylint: disable=line-too-long path_format_arguments = { "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "location": _SERIALIZER.url("location", location, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -135,7 +138,7 @@ class DeletedServicesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -160,9 +163,12 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DeletedServicesCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.DeletedServicesCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.DeletedServicesCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServicesCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -173,6 +179,7 @@ def prepare_request(next_link=None): request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_subscription.metadata['url'], ) request = _convert_request(request) @@ -182,6 +189,7 @@ def prepare_request(next_link=None): request = build_list_by_subscription_request( subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -199,7 +207,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -213,7 +225,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/deletedservices"} # type: ignore @distributed_trace def get_by_name( @@ -230,7 +242,7 @@ def get_by_name( :type location: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DeletedServiceContract, or the result of cls(response) - :rtype: ~api_management_client.models.DeletedServiceContract + :rtype: ~azure.mgmt.apimanagement.models.DeletedServiceContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServiceContract"] @@ -239,17 +251,24 @@ def get_by_name( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_name_request( service_name=service_name, subscription_id=self._config.subscription_id, location=location, + api_version=api_version, template_url=self.get_by_name.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -264,7 +283,7 @@ def get_by_name( return deserialized - get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + get_by_name.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}"} # type: ignore def _purge_initial( @@ -279,17 +298,24 @@ def _purge_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_purge_request_initial( service_name=service_name, subscription_id=self._config.subscription_id, location=location, + api_version=api_version, template_url=self._purge_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -305,7 +331,7 @@ def _purge_initial( return deserialized - _purge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + _purge_initial.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}"} # type: ignore @distributed_trace @@ -331,10 +357,11 @@ def begin_purge( Retry-After header is present. :return: An instance of LROPoller that returns either DeletedServiceContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.DeletedServiceContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.DeletedServiceContract] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.DeletedServiceContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -345,6 +372,7 @@ def begin_purge( raw_result = self._purge_initial( service_name=service_name, location=location, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -368,7 +396,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_purge.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}'} # type: ignore + begin_purge.metadata = {'url': "/subscriptions/{subscriptionId}/providers/Microsoft.ApiManagement/locations/{location}/deletedservices/{serviceName}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_diagnostic_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_diagnostic_operations.py index 57df7d136ed8..3b2cce8000b1 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -289,7 +293,7 @@ class DiagnosticOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -322,18 +326,21 @@ def list_by_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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either DiagnosticCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.DiagnosticCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.DiagnosticCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -346,6 +353,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -360,6 +368,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -380,7 +389,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -394,7 +407,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics"} # type: ignore @distributed_trace def get_entity_tag( @@ -424,18 +437,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -451,7 +471,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace @@ -473,7 +493,7 @@ def get( :type diagnostic_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -482,18 +502,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -511,7 +538,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace @@ -534,13 +561,13 @@ def create_or_update( service instance. :type diagnostic_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -549,6 +576,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -558,6 +586,7 @@ def create_or_update( service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -566,7 +595,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -590,7 +623,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace @@ -616,10 +649,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Diagnostic Update parameters. - :type parameters: ~api_management_client.models.DiagnosticContract + :type parameters: ~azure.mgmt.apimanagement.models.DiagnosticContract :keyword callable cls: A custom type or function that will be passed the direct response :return: DiagnosticContract, or the result of cls(response) - :rtype: ~api_management_client.models.DiagnosticContract + :rtype: ~azure.mgmt.apimanagement.models.DiagnosticContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.DiagnosticContract"] @@ -628,6 +661,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DiagnosticContract') @@ -637,6 +671,7 @@ def update( service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -645,7 +680,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -663,11 +702,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -698,19 +737,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, diagnostic_id=diagnostic_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -721,5 +767,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}"} # type: ignore 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 b4951001138c..fa5a45f6895b 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -289,7 +293,7 @@ class EmailTemplateOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -322,18 +326,21 @@ def list_by_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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either EmailTemplateCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.EmailTemplateCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.EmailTemplateCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -346,6 +353,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -360,6 +368,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -380,7 +389,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -394,7 +407,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates"} # type: ignore @distributed_trace def get_entity_tag( @@ -411,7 +424,7 @@ def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -423,18 +436,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -450,7 +470,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace @@ -468,10 +488,10 @@ def get( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :keyword callable cls: A custom type or function that will be passed the direct response :return: EmailTemplateContract, or the result of cls(response) - :rtype: ~api_management_client.models.EmailTemplateContract + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateContract"] @@ -480,18 +500,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -509,7 +536,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace @@ -529,15 +556,15 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :param parameters: Email Template update parameters. - :type parameters: ~api_management_client.models.EmailTemplateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: EmailTemplateContract, or the result of cls(response) - :rtype: ~api_management_client.models.EmailTemplateContract + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateContract"] @@ -546,6 +573,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'EmailTemplateUpdateParameters') @@ -555,6 +583,7 @@ def create_or_update( service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -563,7 +592,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -582,7 +615,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace @@ -602,15 +635,15 @@ def update( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :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: ~api_management_client.models.EmailTemplateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.EmailTemplateUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: EmailTemplateContract, or the result of cls(response) - :rtype: ~api_management_client.models.EmailTemplateContract + :rtype: ~azure.mgmt.apimanagement.models.EmailTemplateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.EmailTemplateContract"] @@ -619,6 +652,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'EmailTemplateUpdateParameters') @@ -628,6 +662,7 @@ def update( service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -636,7 +671,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -654,11 +693,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -673,7 +712,7 @@ def delete( :param service_name: The name of the API Management service. :type service_name: str :param template_name: Email Template Name Identifier. - :type template_name: str or ~api_management_client.models.TemplateName + :type template_name: str or ~azure.mgmt.apimanagement.models.TemplateName :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 @@ -688,19 +727,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, template_name=template_name, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -711,5 +757,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}"} # type: ignore 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 d7901e83c425..db3e2d52eb5d 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,10 +38,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -49,27 +50,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -94,21 +96,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -124,12 +126,12 @@ def build_create_or_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -138,23 +140,23 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -169,10 +171,11 @@ def build_delete_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -181,21 +184,21 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -206,7 +209,7 @@ class GatewayApiOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -243,17 +246,20 @@ def list_by_service( :type gateway_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | - filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ApiCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -267,6 +273,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -282,6 +289,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -302,7 +310,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -316,7 +328,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis"} # type: ignore @distributed_trace def get_entity_tag( @@ -349,6 +361,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -356,12 +370,17 @@ def get_entity_tag( gateway_id=gateway_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -377,7 +396,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}"} # type: ignore @distributed_trace @@ -401,11 +420,11 @@ def create_or_update( :type gateway_id: str :param api_id: API identifier. Must be unique in the current API Management service instance. :type api_id: str - :param parameters: - :type parameters: ~api_management_client.models.AssociationContract + :param parameters: Default value is None. + :type parameters: ~azure.mgmt.apimanagement.models.AssociationContract :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -414,6 +433,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] if parameters is not None: @@ -427,6 +447,7 @@ def create_or_update( gateway_id=gateway_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.create_or_update.metadata['url'], @@ -434,7 +455,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -453,11 +478,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -487,6 +512,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -494,12 +521,17 @@ def delete( gateway_id=gateway_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -510,5 +542,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py index 60bdc569e414..70d1658a7283 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_certificate_authority_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,10 +38,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -49,27 +50,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -94,21 +96,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -121,10 +123,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -133,21 +136,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,12 +167,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -178,25 +181,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -213,10 +216,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -225,22 +229,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -251,7 +255,7 @@ class GatewayCertificateAuthorityOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -288,19 +292,21 @@ def list_by_service( :type gateway_id: str :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | - filter | eq, ne | |
. + filter | eq, ne | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCertificateAuthorityCollection or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~api_management_client.models.GatewayCertificateAuthorityCollection] + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -314,6 +320,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -329,6 +336,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -349,7 +357,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -363,7 +375,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities"} # type: ignore @distributed_trace def get_entity_tag( @@ -397,6 +409,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -404,12 +418,17 @@ def get_entity_tag( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -425,7 +444,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore @distributed_trace @@ -451,7 +470,7 @@ def get( :type certificate_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCertificateAuthorityContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayCertificateAuthorityContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] @@ -460,6 +479,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -467,12 +488,17 @@ def get( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -490,7 +516,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore @distributed_trace @@ -517,13 +543,13 @@ def create_or_update( Management service instance. :type certificate_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayCertificateAuthorityContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayCertificateAuthorityContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayCertificateAuthorityContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayCertificateAuthorityContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCertificateAuthorityContract"] @@ -532,6 +558,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayCertificateAuthorityContract') @@ -542,6 +569,7 @@ def create_or_update( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -550,7 +578,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -574,11 +606,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -613,6 +645,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -620,13 +654,18 @@ def delete( gateway_id=gateway_id, certificate_id=certificate_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -637,5 +676,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/certificateAuthorities/{certificateId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_hostname_configuration_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_gateway_hostname_configuration_operations.py index e7a536356bf1..218303bc86b3 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,10 +38,11 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -49,27 +50,27 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -94,21 +96,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -121,10 +123,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -133,21 +136,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -164,12 +167,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -178,25 +181,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -213,10 +216,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -225,22 +229,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -251,7 +255,7 @@ class GatewayHostnameConfigurationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -289,19 +293,22 @@ def list_by_service( :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 |
. + | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayHostnameConfigurationCollection or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~api_management_client.models.GatewayHostnameConfigurationCollection] + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayHostnameConfigurationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -315,6 +322,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -330,6 +338,7 @@ def prepare_request(next_link=None): service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -350,7 +359,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -364,7 +377,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations"} # type: ignore @distributed_trace def get_entity_tag( @@ -399,6 +412,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -406,12 +421,17 @@ def get_entity_tag( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -427,7 +447,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore @distributed_trace @@ -453,7 +473,7 @@ def get( :type hc_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayHostnameConfigurationContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayHostnameConfigurationContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayHostnameConfigurationContract"] @@ -462,6 +482,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -469,12 +491,17 @@ def get( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -492,7 +519,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore @distributed_trace @@ -519,13 +546,13 @@ def create_or_update( Gateway entity. :type hc_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayHostnameConfigurationContract + :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. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayHostnameConfigurationContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayHostnameConfigurationContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayHostnameConfigurationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayHostnameConfigurationContract"] @@ -534,6 +561,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayHostnameConfigurationContract') @@ -544,6 +572,7 @@ def create_or_update( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -552,7 +581,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -576,11 +609,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -615,6 +648,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -622,13 +657,18 @@ def delete( gateway_id=gateway_id, hc_id=hc_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -639,5 +679,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}"} # type: ignore 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 784480f5d4c5..248a27057ddf 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -290,10 +294,11 @@ def build_list_keys_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -301,21 +306,21 @@ def build_list_keys_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -330,12 +335,12 @@ def build_regenerate_key_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -343,23 +348,23 @@ def build_regenerate_key_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -376,12 +381,12 @@ def build_generate_token_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -389,23 +394,23 @@ def build_generate_token_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -418,7 +423,7 @@ class GatewayOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -454,17 +459,19 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GatewayCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.GatewayCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GatewayCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -477,6 +484,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -491,6 +499,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -511,7 +520,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -525,7 +538,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways"} # type: ignore @distributed_trace def get_entity_tag( @@ -555,18 +568,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -582,7 +602,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace @@ -604,7 +624,7 @@ def get( :type gateway_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayContract"] @@ -613,18 +633,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -642,7 +669,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace @@ -665,13 +692,13 @@ def create_or_update( service instance. Must not have value 'managed'. :type gateway_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayContract"] @@ -680,6 +707,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayContract') @@ -689,6 +717,7 @@ def create_or_update( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -697,7 +726,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -721,7 +754,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace @@ -747,10 +780,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: - :type parameters: ~api_management_client.models.GatewayContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayContract :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayContract"] @@ -759,6 +792,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayContract') @@ -768,6 +802,7 @@ def update( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -776,7 +811,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -794,11 +833,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -829,19 +868,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -852,7 +898,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}"} # type: ignore @distributed_trace @@ -874,7 +920,7 @@ def list_keys( :type gateway_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayKeysContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayKeysContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayKeysContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayKeysContract"] @@ -883,18 +929,25 @@ def list_keys( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_keys_request( resource_group_name=resource_group_name, service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_keys.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -912,11 +965,11 @@ def list_keys( return deserialized - list_keys.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys'} # type: ignore + list_keys.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys"} # type: ignore @distributed_trace - def regenerate_key( + def regenerate_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -934,7 +987,7 @@ def regenerate_key( service instance. Must not have value 'managed'. :type gateway_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayKeyRegenerationRequestContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayKeyRegenerationRequestContract :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -946,6 +999,7 @@ def regenerate_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayKeyRegenerationRequestContract') @@ -955,6 +1009,7 @@ def regenerate_key( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.regenerate_key.metadata['url'], @@ -962,7 +1017,11 @@ def regenerate_key( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -973,7 +1032,7 @@ def regenerate_key( if cls: return cls(pipeline_response, None, {}) - regenerate_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey'} # type: ignore + regenerate_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey"} # type: ignore @distributed_trace @@ -995,10 +1054,10 @@ def generate_token( service instance. Must not have value 'managed'. :type gateway_id: str :param parameters: - :type parameters: ~api_management_client.models.GatewayTokenRequestContract + :type parameters: ~azure.mgmt.apimanagement.models.GatewayTokenRequestContract :keyword callable cls: A custom type or function that will be passed the direct response :return: GatewayTokenContract, or the result of cls(response) - :rtype: ~api_management_client.models.GatewayTokenContract + :rtype: ~azure.mgmt.apimanagement.models.GatewayTokenContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GatewayTokenContract"] @@ -1007,6 +1066,7 @@ def generate_token( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GatewayTokenRequestContract') @@ -1016,6 +1076,7 @@ def generate_token( service_name=service_name, gateway_id=gateway_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.generate_token.metadata['url'], @@ -1023,7 +1084,11 @@ def generate_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1038,5 +1103,5 @@ def generate_token( return deserialized - generate_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken'} # type: ignore + generate_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_global_schema_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_global_schema_operations.py index 4f77dca140ca..1ce84134244d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_global_schema_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_global_schema_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,37 +39,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -81,10 +82,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -92,21 +94,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -118,10 +120,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -129,21 +132,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -159,12 +162,12 @@ def build_create_or_update_request_initial( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -172,25 +175,25 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,10 +209,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -217,22 +221,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -243,7 +247,7 @@ class GlobalSchemaOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -276,18 +280,21 @@ def list_by_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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GlobalSchemaCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.GlobalSchemaCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GlobalSchemaCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GlobalSchemaCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -300,6 +307,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -314,6 +322,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -334,7 +343,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -348,7 +361,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas"} # type: ignore @distributed_trace def get_entity_tag( @@ -378,18 +391,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -405,7 +425,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore @distributed_trace @@ -427,7 +447,7 @@ def get( :type schema_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GlobalSchemaContract, or the result of cls(response) - :rtype: ~api_management_client.models.GlobalSchemaContract + :rtype: ~azure.mgmt.apimanagement.models.GlobalSchemaContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GlobalSchemaContract"] @@ -436,18 +456,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -465,7 +492,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore def _create_or_update_initial( @@ -483,6 +510,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GlobalSchemaContract') @@ -492,6 +520,7 @@ def _create_or_update_initial( service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -500,7 +529,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -524,7 +557,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore @distributed_trace @@ -547,9 +580,9 @@ def begin_create_or_update( instance. :type schema_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.GlobalSchemaContract + :type parameters: ~azure.mgmt.apimanagement.models.GlobalSchemaContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -561,11 +594,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either GlobalSchemaContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.GlobalSchemaContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.GlobalSchemaContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.GlobalSchemaContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -579,6 +613,7 @@ def begin_create_or_update( schema_id=schema_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -606,13 +641,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -643,19 +677,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, schema_id=schema_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -666,5 +707,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}"} # type: ignore 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 bc36b3954f2e..dac4fc6a6353 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -289,7 +293,7 @@ class GroupOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -325,17 +329,19 @@ def list_by_service( filter | ge, le, eq, ne, gt, lt | substringof, contains, 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 |
| externalId | filter | eq | |
. + endswith |
| externalId | filter | eq | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GroupCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.GroupCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GroupCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -348,6 +354,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -362,6 +369,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -382,7 +390,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -396,7 +408,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups"} # type: ignore @distributed_trace def get_entity_tag( @@ -426,18 +438,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -453,7 +472,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace @@ -475,7 +494,7 @@ def get( :type group_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -484,18 +503,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -513,7 +539,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace @@ -536,13 +562,13 @@ def create_or_update( instance. :type group_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.GroupCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.GroupCreateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -551,6 +577,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GroupCreateParameters') @@ -560,6 +587,7 @@ def create_or_update( service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -568,7 +596,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -592,7 +624,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace @@ -618,10 +650,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.GroupUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.GroupUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -630,6 +662,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'GroupUpdateParameters') @@ -639,6 +672,7 @@ def update( service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -647,7 +681,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -665,11 +703,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -700,19 +738,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -723,5 +768,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}"} # type: ignore 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 76fb5f0a1397..d20083f78229 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -81,10 +82,11 @@ def build_check_entity_exists_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -93,21 +95,21 @@ def build_check_entity_exists_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -120,10 +122,11 @@ def build_create_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -132,21 +135,21 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -159,10 +162,11 @@ def build_delete_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -171,21 +175,21 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -196,7 +200,7 @@ class GroupUserOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -238,17 +242,19 @@ def list( 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 |
. + le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either UserCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.UserCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.UserCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -262,6 +268,7 @@ def prepare_request(next_link=None): service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -277,6 +284,7 @@ def prepare_request(next_link=None): service_name=service_name, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -297,7 +305,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -311,7 +323,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users"} # type: ignore @distributed_trace def check_entity_exists( @@ -344,6 +356,8 @@ def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -351,12 +365,17 @@ def check_entity_exists( group_id=group_id, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -368,7 +387,7 @@ def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}"} # type: ignore @distributed_trace @@ -393,7 +412,7 @@ def create( :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -402,6 +421,8 @@ def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_request( resource_group_name=resource_group_name, @@ -409,12 +430,17 @@ def create( group_id=group_id, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -433,11 +459,11 @@ def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -467,6 +493,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -474,12 +502,17 @@ def delete( group_id=group_id, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -490,5 +523,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}"} # type: ignore 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 8270aa523bf1..292a5a95928b 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,31 +33,32 @@ def build_list_by_service_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -69,10 +70,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -80,21 +82,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -106,10 +108,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -117,21 +120,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -147,12 +150,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -160,25 +163,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -196,12 +199,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -209,24 +212,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -242,10 +245,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -253,22 +257,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -280,10 +284,11 @@ def build_list_secrets_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -291,21 +296,21 @@ def build_list_secrets_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -316,7 +321,7 @@ class IdentityProviderOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -347,9 +352,11 @@ def list_by_service( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IdentityProviderList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.IdentityProviderList] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.IdentityProviderList] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderList"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -362,6 +369,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -373,6 +381,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -390,7 +399,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -404,7 +417,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders"} # type: ignore @distributed_trace def get_entity_tag( @@ -421,7 +434,7 @@ def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -433,18 +446,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -460,7 +480,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace @@ -479,10 +499,10 @@ def get( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword callable cls: A custom type or function that will be passed the direct response :return: IdentityProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.IdentityProviderContract + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderContract"] @@ -491,18 +511,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -520,7 +547,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace @@ -540,15 +567,15 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :param parameters: Create parameters. - :type parameters: ~api_management_client.models.IdentityProviderCreateContract + :type parameters: ~azure.mgmt.apimanagement.models.IdentityProviderCreateContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IdentityProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.IdentityProviderContract + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderContract"] @@ -557,6 +584,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IdentityProviderCreateContract') @@ -566,6 +594,7 @@ def create_or_update( service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -574,7 +603,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -598,7 +631,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace @@ -618,15 +651,15 @@ def update( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :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: ~api_management_client.models.IdentityProviderUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.IdentityProviderUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: IdentityProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.IdentityProviderContract + :rtype: ~azure.mgmt.apimanagement.models.IdentityProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IdentityProviderContract"] @@ -635,6 +668,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'IdentityProviderUpdateParameters') @@ -644,6 +678,7 @@ def update( service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -652,7 +687,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -670,11 +709,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -689,7 +728,7 @@ def delete( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :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 @@ -704,19 +743,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -727,7 +773,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}"} # type: ignore @distributed_trace @@ -745,10 +791,10 @@ def list_secrets( :param service_name: The name of the API Management service. :type service_name: str :param identity_provider_name: Identity Provider Type identifier. - :type identity_provider_name: str or ~api_management_client.models.IdentityProviderType + :type identity_provider_name: str or ~azure.mgmt.apimanagement.models.IdentityProviderType :keyword callable cls: A custom type or function that will be passed the direct response :return: ClientSecretContract, or the result of cls(response) - :rtype: ~api_management_client.models.ClientSecretContract + :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientSecretContract"] @@ -757,18 +803,25 @@ def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, identity_provider_name=identity_provider_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -786,5 +839,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets"} # type: ignore 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 7f1d97aacc24..83fdc3b9f5e5 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -36,37 +36,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -78,10 +79,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -89,21 +91,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -114,7 +116,7 @@ class IssueOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -152,17 +154,19 @@ def list_by_service( 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 | |
. + endswith |
| state | filter | eq | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either IssueCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.IssueCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.IssueCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -175,6 +179,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -189,6 +194,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -209,7 +215,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -223,7 +233,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues"} # type: ignore @distributed_trace def get( @@ -244,7 +254,7 @@ def get( :type issue_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: IssueContract, or the result of cls(response) - :rtype: ~api_management_client.models.IssueContract + :rtype: ~azure.mgmt.apimanagement.models.IssueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.IssueContract"] @@ -253,18 +263,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, issue_id=issue_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -282,5 +299,5 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}"} # type: ignore 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 7c176f575994..eb657bf9e231 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -289,7 +293,7 @@ class LoggerOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -325,17 +329,19 @@ def list_by_service( 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 |
. + substringof, contains, startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either LoggerCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.LoggerCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.LoggerCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -348,6 +354,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -362,6 +369,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -382,7 +390,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -396,7 +408,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers"} # type: ignore @distributed_trace def get_entity_tag( @@ -425,18 +437,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -452,7 +471,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace @@ -473,7 +492,7 @@ def get( :type logger_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LoggerContract, or the result of cls(response) - :rtype: ~api_management_client.models.LoggerContract + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerContract"] @@ -482,18 +501,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -511,7 +537,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace @@ -533,13 +559,13 @@ def create_or_update( :param logger_id: Logger identifier. Must be unique in the API Management service instance. :type logger_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.LoggerContract + :type parameters: ~azure.mgmt.apimanagement.models.LoggerContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: LoggerContract, or the result of cls(response) - :rtype: ~api_management_client.models.LoggerContract + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerContract"] @@ -548,6 +574,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LoggerContract') @@ -557,6 +584,7 @@ def create_or_update( service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -565,7 +593,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -589,7 +621,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace @@ -614,10 +646,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.LoggerUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.LoggerUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: LoggerContract, or the result of cls(response) - :rtype: ~api_management_client.models.LoggerContract + :rtype: ~azure.mgmt.apimanagement.models.LoggerContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.LoggerContract"] @@ -626,6 +658,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'LoggerUpdateContract') @@ -635,6 +668,7 @@ def update( service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -643,7 +677,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -661,11 +699,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -695,19 +733,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, logger_id=logger_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -718,5 +763,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}"} # type: ignore 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 9392f40884fd..9906389e3bea 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -40,39 +40,40 @@ def build_list_by_service_request( is_key_vault_refresh_failed: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if is_key_vault_refresh_failed is not None: - query_parameters['isKeyVaultRefreshFailed'] = _SERIALIZER.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['isKeyVaultRefreshFailed'] = _SERIALIZER.query("is_key_vault_refresh_failed", is_key_vault_refresh_failed, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -84,10 +85,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -95,21 +97,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -121,10 +123,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -132,21 +135,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -162,12 +165,12 @@ def build_create_or_update_request_initial( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -175,25 +178,25 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -211,12 +214,12 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -224,24 +227,24 @@ def build_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -257,10 +260,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -268,22 +272,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -295,10 +299,11 @@ def build_list_value_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -306,21 +311,21 @@ def build_list_value_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -332,10 +337,11 @@ def build_refresh_secret_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -343,21 +349,21 @@ def build_refresh_secret_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -368,7 +374,7 @@ class NamedValueOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -404,21 +410,23 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :param is_key_vault_refresh_failed: When set to true, the response contains only named value - entities which failed refresh. + entities which failed refresh. Default value is None. :type is_key_vault_refresh_failed: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NamedValueCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.NamedValueCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.NamedValueCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -431,6 +439,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -446,6 +455,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -467,7 +477,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -481,7 +495,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues"} # type: ignore @distributed_trace def get_entity_tag( @@ -510,18 +524,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -537,7 +558,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace @@ -558,7 +579,7 @@ def get( :type named_value_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NamedValueContract, or the result of cls(response) - :rtype: ~api_management_client.models.NamedValueContract + :rtype: ~azure.mgmt.apimanagement.models.NamedValueContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] @@ -567,18 +588,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -596,7 +624,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore def _create_or_update_initial( @@ -614,6 +642,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'NamedValueCreateContract') @@ -623,6 +652,7 @@ def _create_or_update_initial( service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -631,7 +661,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201, 202]: @@ -655,7 +689,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace @@ -677,9 +711,9 @@ def begin_create_or_update( :param named_value_id: Identifier of the NamedValue. :type named_value_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.NamedValueCreateContract + :type parameters: ~azure.mgmt.apimanagement.models.NamedValueCreateContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. @@ -691,11 +725,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either NamedValueContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.NamedValueContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -709,6 +744,7 @@ def begin_create_or_update( named_value_id=named_value_id, parameters=parameters, if_match=if_match, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -736,10 +772,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore def _update_initial( self, @@ -756,6 +791,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'NamedValueUpdateParameters') @@ -765,6 +801,7 @@ def _update_initial( service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -773,7 +810,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -792,7 +833,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace @@ -817,7 +858,7 @@ def begin_update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.NamedValueUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.NamedValueUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -828,11 +869,12 @@ def begin_update( Retry-After header is present. :return: An instance of LROPoller that returns either NamedValueContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.NamedValueContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -846,6 +888,7 @@ def begin_update( named_value_id=named_value_id, if_match=if_match, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -873,13 +916,12 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -909,19 +951,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -932,7 +981,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}"} # type: ignore @distributed_trace @@ -953,7 +1002,7 @@ def list_value( :type named_value_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NamedValueSecretContract, or the result of cls(response) - :rtype: ~api_management_client.models.NamedValueSecretContract + :rtype: ~azure.mgmt.apimanagement.models.NamedValueSecretContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueSecretContract"] @@ -962,18 +1011,25 @@ def list_value( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_value_request( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_value.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -991,7 +1047,7 @@ def list_value( return deserialized - list_value.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue'} # type: ignore + list_value.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue"} # type: ignore def _refresh_secret_initial( @@ -1007,18 +1063,25 @@ def _refresh_secret_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_refresh_secret_request_initial( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._refresh_secret_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -1037,7 +1100,7 @@ def _refresh_secret_initial( return deserialized - _refresh_secret_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore + _refresh_secret_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret"} # type: ignore @distributed_trace @@ -1066,10 +1129,11 @@ def begin_refresh_secret( Retry-After header is present. :return: An instance of LROPoller that returns either NamedValueContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.NamedValueContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.NamedValueContract] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.NamedValueContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -1081,6 +1145,7 @@ def begin_refresh_secret( resource_group_name=resource_group_name, service_name=service_name, named_value_id=named_value_id, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -1107,7 +1172,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_refresh_secret.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret'} # type: ignore + begin_refresh_secret.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/refreshSecret"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_network_status_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_network_status_operations.py index e08388461e8d..564180ed5ac2 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, List, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, List, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -31,31 +31,32 @@ def build_list_by_service_request( service_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -67,10 +68,11 @@ def build_list_by_location_request( location_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), @@ -78,21 +80,21 @@ def build_list_by_location_request( "locationName": _SERIALIZER.url("location_name", location_name, 'str', min_length=1), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -103,7 +105,7 @@ class NetworkStatusOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -135,7 +137,7 @@ def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: list of NetworkStatusContractByLocation, or the result of cls(response) - :rtype: list[~api_management_client.models.NetworkStatusContractByLocation] + :rtype: list[~azure.mgmt.apimanagement.models.NetworkStatusContractByLocation] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType[List["_models.NetworkStatusContractByLocation"]] @@ -144,17 +146,24 @@ def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -169,7 +178,7 @@ def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/networkstatus"} # type: ignore @distributed_trace @@ -193,7 +202,7 @@ def list_by_location( :type location_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NetworkStatusContract, or the result of cls(response) - :rtype: ~api_management_client.models.NetworkStatusContract + :rtype: ~azure.mgmt.apimanagement.models.NetworkStatusContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NetworkStatusContract"] @@ -202,18 +211,25 @@ def list_by_location( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_location_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, location_name=location_name, + api_version=api_version, template_url=self.list_by_location.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -228,5 +244,5 @@ def list_by_location( return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus'} # type: ignore + list_by_location.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/locations/{locationName}/networkstatus"} # type: ignore 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 eb180a16c320..a2d210c0ef5a 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,35 +35,36 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -75,10 +76,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -86,21 +88,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -114,10 +116,11 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -125,23 +128,23 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -152,7 +155,7 @@ class NotificationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -182,16 +185,18 @@ def list_by_service( :type resource_group_name: str :param service_name: The name of the API Management service. :type service_name: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either NotificationCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.NotificationCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.NotificationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -204,6 +209,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=self.list_by_service.metadata['url'], @@ -217,6 +223,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, top=top, skip=skip, template_url=next_link, @@ -236,7 +243,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -250,7 +261,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications"} # type: ignore @distributed_trace def get( @@ -267,10 +278,10 @@ def get( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :keyword callable cls: A custom type or function that will be passed the direct response :return: NotificationContract, or the result of cls(response) - :rtype: ~api_management_client.models.NotificationContract + :rtype: ~azure.mgmt.apimanagement.models.NotificationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationContract"] @@ -279,18 +290,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -305,7 +323,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}"} # type: ignore @distributed_trace @@ -324,13 +342,13 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: NotificationContract, or the result of cls(response) - :rtype: ~api_management_client.models.NotificationContract + :rtype: ~azure.mgmt.apimanagement.models.NotificationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.NotificationContract"] @@ -339,19 +357,26 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -366,5 +391,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}"} # type: ignore 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 4e6a042c0b92..bc3069c7818a 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,10 +32,11 @@ def build_list_by_notification_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -43,21 +44,21 @@ def build_list_by_notification_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -70,10 +71,11 @@ def build_check_entity_exists_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -82,21 +84,21 @@ def build_check_entity_exists_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -109,10 +111,11 @@ def build_create_or_update_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -121,21 +124,21 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -148,10 +151,11 @@ def build_delete_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -160,21 +164,21 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -185,7 +189,7 @@ class NotificationRecipientEmailOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -215,10 +219,10 @@ def list_by_notification( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientEmailCollection, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientEmailCollection + :rtype: ~azure.mgmt.apimanagement.models.RecipientEmailCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientEmailCollection"] @@ -227,18 +231,25 @@ def list_by_notification( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_notification_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_notification.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -253,7 +264,7 @@ def list_by_notification( return deserialized - list_by_notification.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails'} # type: ignore + list_by_notification.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails"} # type: ignore @distributed_trace @@ -272,7 +283,7 @@ def check_entity_exists( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param email: Email identifier. :type email: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -286,6 +297,8 @@ def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -293,12 +306,17 @@ def check_entity_exists( notification_name=notification_name, email=email, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -310,7 +328,7 @@ def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}"} # type: ignore @distributed_trace @@ -329,12 +347,12 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param email: Email identifier. :type email: str :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientEmailContract, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientEmailContract + :rtype: ~azure.mgmt.apimanagement.models.RecipientEmailContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientEmailContract"] @@ -343,6 +361,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -350,12 +370,17 @@ def create_or_update( notification_name=notification_name, email=email, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -374,11 +399,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -393,7 +418,7 @@ def delete( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param email: Email identifier. :type email: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,6 +432,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -414,12 +441,17 @@ def delete( notification_name=notification_name, email=email, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -430,5 +462,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientEmails/{email}"} # type: ignore 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 af00d3806ca9..7e75ce163b41 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,10 +32,11 @@ def build_list_by_notification_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -43,21 +44,21 @@ def build_list_by_notification_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -70,10 +71,11 @@ def build_check_entity_exists_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -82,21 +84,21 @@ def build_check_entity_exists_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -109,10 +111,11 @@ def build_create_or_update_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -121,21 +124,21 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -148,10 +151,11 @@ def build_delete_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -160,21 +164,21 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -185,7 +189,7 @@ class NotificationRecipientUserOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -215,10 +219,10 @@ def list_by_notification( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientUserCollection, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientUserCollection + :rtype: ~azure.mgmt.apimanagement.models.RecipientUserCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientUserCollection"] @@ -227,18 +231,25 @@ def list_by_notification( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_notification_request( resource_group_name=resource_group_name, service_name=service_name, notification_name=notification_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_notification.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -253,7 +264,7 @@ def list_by_notification( return deserialized - list_by_notification.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers'} # type: ignore + list_by_notification.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers"} # type: ignore @distributed_trace @@ -272,7 +283,7 @@ def check_entity_exists( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -286,6 +297,8 @@ def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -293,12 +306,17 @@ def check_entity_exists( notification_name=notification_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204, 404]: @@ -310,7 +328,7 @@ def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}"} # type: ignore @distributed_trace @@ -329,12 +347,12 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: RecipientUserContract, or the result of cls(response) - :rtype: ~api_management_client.models.RecipientUserContract + :rtype: ~azure.mgmt.apimanagement.models.RecipientUserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.RecipientUserContract"] @@ -343,6 +361,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -350,12 +370,17 @@ def create_or_update( notification_name=notification_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -374,11 +399,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -393,7 +418,7 @@ def delete( :param service_name: The name of the API Management service. :type service_name: str :param notification_name: Notification Name Identifier. - :type notification_name: str or ~api_management_client.models.NotificationName + :type notification_name: str or ~azure.mgmt.apimanagement.models.NotificationName :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -407,6 +432,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -414,12 +441,17 @@ def delete( notification_name=notification_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -430,5 +462,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}"} # type: ignore 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 18d7fc5d6291..7f040f082611 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -170,25 +173,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,12 +209,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -219,24 +222,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -252,10 +255,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -263,22 +267,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -290,10 +294,11 @@ def build_list_secrets_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -301,21 +306,21 @@ def build_list_secrets_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -326,7 +331,7 @@ class OpenIdConnectProviderOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -361,19 +366,21 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OpenIdConnectProviderCollection or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~api_management_client.models.OpenIdConnectProviderCollection] + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.OpenIdConnectProviderCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenIdConnectProviderCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -386,6 +393,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -400,6 +408,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -420,7 +429,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -434,7 +447,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders"} # type: ignore @distributed_trace def get_entity_tag( @@ -463,18 +476,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -490,7 +510,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace @@ -511,7 +531,7 @@ def get( :type opid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OpenidConnectProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.OpenidConnectProviderContract + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenidConnectProviderContract"] @@ -520,18 +540,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -549,7 +576,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace @@ -571,13 +598,13 @@ def create_or_update( :param opid: Identifier of the OpenID Connect Provider. :type opid: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.OpenidConnectProviderContract + :type parameters: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OpenidConnectProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.OpenidConnectProviderContract + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenidConnectProviderContract"] @@ -586,6 +613,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OpenidConnectProviderContract') @@ -595,6 +623,7 @@ def create_or_update( service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -603,7 +632,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -627,7 +660,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace @@ -652,10 +685,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.OpenidConnectProviderUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.OpenidConnectProviderUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: OpenidConnectProviderContract, or the result of cls(response) - :rtype: ~api_management_client.models.OpenidConnectProviderContract + :rtype: ~azure.mgmt.apimanagement.models.OpenidConnectProviderContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OpenidConnectProviderContract"] @@ -664,6 +697,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'OpenidConnectProviderUpdateContract') @@ -673,6 +707,7 @@ def update( service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -681,7 +716,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -699,11 +738,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -733,19 +772,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -756,7 +802,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}"} # type: ignore @distributed_trace @@ -777,7 +823,7 @@ def list_secrets( :type opid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ClientSecretContract, or the result of cls(response) - :rtype: ~api_management_client.models.ClientSecretContract + :rtype: ~azure.mgmt.apimanagement.models.ClientSecretContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ClientSecretContract"] @@ -786,18 +832,25 @@ def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, opid=opid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -815,5 +868,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets"} # type: ignore 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 009fc1d9d6c3..b7d3061055cb 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,10 +38,11 @@ def build_list_by_tags_request( include_not_tagged_operations: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -49,29 +50,29 @@ def build_list_by_tags_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if include_not_tagged_operations is not None: - query_parameters['includeNotTaggedOperations'] = _SERIALIZER.query("include_not_tagged_operations", include_not_tagged_operations, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['includeNotTaggedOperations'] = _SERIALIZER.query("include_not_tagged_operations", include_not_tagged_operations, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,7 +83,7 @@ class OperationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -126,20 +127,22 @@ def list_by_tags( |
| 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 |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param include_not_tagged_operations: Include not tagged Operations. + :param include_not_tagged_operations: Include not tagged Operations. Default value is None. :type include_not_tagged_operations: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagResourceCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -153,6 +156,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -169,6 +173,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -190,7 +195,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -204,4 +213,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags'} # type: ignore + list_by_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operationsByTags"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_outbound_network_dependencies_endpoints_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_outbound_network_dependencies_endpoints_operations.py index 628cccd96107..46f6ffed4d31 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_outbound_network_dependencies_endpoints_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_outbound_network_dependencies_endpoints_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -31,31 +31,32 @@ def build_list_by_service_request( service_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/outboundNetworkDependenciesEndpoints') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/outboundNetworkDependenciesEndpoints") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -66,7 +67,7 @@ class OutboundNetworkDependenciesEndpointsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -96,7 +97,7 @@ def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: OutboundEnvironmentEndpointList, or the result of cls(response) - :rtype: ~api_management_client.models.OutboundEnvironmentEndpointList + :rtype: ~azure.mgmt.apimanagement.models.OutboundEnvironmentEndpointList :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OutboundEnvironmentEndpointList"] @@ -105,17 +106,24 @@ def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -130,5 +138,5 @@ def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/outboundNetworkDependenciesEndpoints'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/outboundNetworkDependenciesEndpoints"} # type: ignore 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 403985c5cb00..df8dfa3b7279 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,33 +33,34 @@ def build_list_by_service_request( scope: Optional[Union[str, "_models.PolicyScopeContract"]] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if scope is not None: - query_parameters['scope'] = _SERIALIZER.query("scope", scope, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['scope'] = _SERIALIZER.query("scope", scope, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -70,7 +71,7 @@ class PolicyDescriptionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -99,11 +100,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 scope: Policy scope. - :type scope: str or ~api_management_client.models.PolicyScopeContract + :param scope: Policy scope. Default value is None. + :type scope: str or ~azure.mgmt.apimanagement.models.PolicyScopeContract :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyDescriptionCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyDescriptionCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyDescriptionCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyDescriptionCollection"] @@ -112,18 +113,25 @@ def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, scope=scope, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -138,5 +146,5 @@ def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions"} # type: ignore 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 10288c26e03d..63e312242678 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_list_by_service_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -68,10 +69,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -79,21 +81,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -107,10 +109,11 @@ def build_get_request( format: Optional[Union[str, "_models.PolicyExportFormat"]] = "xml", **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -118,23 +121,23 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if format is not None: - query_parameters['format'] = _SERIALIZER.query("format", format, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['format'] = _SERIALIZER.query("format", format, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -150,12 +153,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -163,25 +166,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -197,10 +200,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -208,22 +212,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -234,7 +238,7 @@ class PolicyOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -264,7 +268,7 @@ def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -273,17 +277,24 @@ def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -298,7 +309,7 @@ def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies"} # type: ignore @distributed_trace @@ -317,7 +328,7 @@ def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -329,18 +340,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -356,7 +374,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore @distributed_trace @@ -375,12 +393,12 @@ def get( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -389,19 +407,26 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -419,7 +444,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore @distributed_trace @@ -439,15 +464,15 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -456,6 +481,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -465,6 +491,7 @@ def create_or_update( service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -473,7 +500,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -497,11 +528,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -516,7 +547,7 @@ def delete( :param service_name: The name of the API Management service. :type service_name: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -531,19 +562,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -554,5 +592,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py index 0c7473630347..4cef8411e47b 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_portal_revision_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,37 +39,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -81,10 +82,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -92,21 +94,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -118,10 +120,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -129,21 +132,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -158,12 +161,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -171,23 +174,23 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -205,12 +208,12 @@ def build_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -218,24 +221,24 @@ def build_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -248,7 +251,7 @@ class PortalRevisionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -290,18 +293,20 @@ def list_by_service( |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 | |. + |isCurrent | eq, ne | |. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either PortalRevisionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.PortalRevisionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.PortalRevisionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -314,6 +319,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -328,6 +334,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -348,7 +355,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -362,7 +373,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions"} # type: ignore @distributed_trace def get_entity_tag( @@ -392,18 +403,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -419,7 +437,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore @distributed_trace @@ -441,7 +459,7 @@ def get( :type portal_revision_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalRevisionContract, or the result of cls(response) - :rtype: ~api_management_client.models.PortalRevisionContract + :rtype: ~azure.mgmt.apimanagement.models.PortalRevisionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionContract"] @@ -450,18 +468,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -479,7 +504,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore def _create_or_update_initial( @@ -496,6 +521,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalRevisionContract') @@ -505,6 +531,7 @@ def _create_or_update_initial( service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -512,7 +539,11 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [201, 202]: @@ -531,7 +562,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore @distributed_trace @@ -554,7 +585,7 @@ def begin_create_or_update( Management service instance. :type portal_revision_id: str :param parameters: - :type parameters: ~api_management_client.models.PortalRevisionContract + :type parameters: ~azure.mgmt.apimanagement.models.PortalRevisionContract :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -565,11 +596,12 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either PortalRevisionContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.PortalRevisionContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.PortalRevisionContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -582,6 +614,7 @@ def begin_create_or_update( service_name=service_name, portal_revision_id=portal_revision_id, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -609,10 +642,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore def _update_initial( self, @@ -629,6 +661,7 @@ def _update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalRevisionContract') @@ -638,6 +671,7 @@ def _update_initial( service_name=service_name, portal_revision_id=portal_revision_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -646,7 +680,11 @@ def _update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -665,7 +703,7 @@ def _update_initial( return deserialized - _update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + _update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore @distributed_trace @@ -691,7 +729,7 @@ def begin_update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: - :type parameters: ~api_management_client.models.PortalRevisionContract + :type parameters: ~azure.mgmt.apimanagement.models.PortalRevisionContract :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -702,11 +740,12 @@ def begin_update( Retry-After header is present. :return: An instance of LROPoller that returns either PortalRevisionContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.PortalRevisionContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.PortalRevisionContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalRevisionContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -720,6 +759,7 @@ def begin_update( portal_revision_id=portal_revision_id, if_match=if_match, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -747,7 +787,6 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}'} # type: ignore + begin_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalRevisions/{portalRevisionId}"} # type: ignore 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 index 8bb66776b1a3..2ed8ecb8bc1d 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -31,31 +31,32 @@ def build_list_by_service_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -66,7 +67,7 @@ class PortalSettingsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -96,7 +97,7 @@ def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSettingsCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSettingsCollection + :rtype: ~azure.mgmt.apimanagement.models.PortalSettingsCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSettingsCollection"] @@ -105,17 +106,24 @@ def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -130,5 +138,5 @@ def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_private_endpoint_connection_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_private_endpoint_connection_operations.py index 02b1d94345e4..52252902d73d 100644 --- a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_private_endpoint_connection_operations.py +++ b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_private_endpoint_connection_operations.py @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -18,7 +19,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,31 +35,32 @@ def build_list_by_service_request( service_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections") # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -71,10 +72,11 @@ def build_get_by_name_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -82,21 +84,21 @@ def build_get_by_name_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -111,12 +113,12 @@ def build_create_or_update_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -124,23 +126,23 @@ def build_create_or_update_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -154,10 +156,11 @@ def build_delete_request_initial( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -165,21 +168,21 @@ def build_delete_request_initial( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -190,31 +193,32 @@ def build_list_private_link_resources_request( service_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), "serviceName": _SERIALIZER.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])?$'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -226,10 +230,11 @@ def build_get_private_link_resource_request( private_link_sub_resource_name: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources/{privateLinkSubResourceName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources/{privateLinkSubResourceName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), @@ -237,21 +242,21 @@ def build_get_private_link_resource_request( "privateLinkSubResourceName": _SERIALIZER.url("private_link_sub_resource_name", private_link_sub_resource_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -262,7 +267,7 @@ class PrivateEndpointConnectionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -294,9 +299,11 @@ def list_by_service( :return: An iterator like instance of either PrivateEndpointConnectionListResult or the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~api_management_client.models.PrivateEndpointConnectionListResult] + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.PrivateEndpointConnectionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnectionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -309,6 +316,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -320,6 +328,7 @@ def prepare_request(next_link=None): subscription_id=self._config.subscription_id, resource_group_name=resource_group_name, service_name=service_name, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -337,7 +346,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -351,7 +364,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections"} # type: ignore @distributed_trace def get_by_name( @@ -371,7 +384,7 @@ def get_by_name( :type private_endpoint_connection_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateEndpointConnection, or the result of cls(response) - :rtype: ~api_management_client.models.PrivateEndpointConnection + :rtype: ~azure.mgmt.apimanagement.models.PrivateEndpointConnection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] @@ -380,18 +393,25 @@ def get_by_name( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_name_request( resource_group_name=resource_group_name, service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_name.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -406,7 +426,7 @@ def get_by_name( return deserialized - get_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + get_by_name.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore def _create_or_update_initial( @@ -423,6 +443,7 @@ def _create_or_update_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(private_endpoint_connection_request, 'PrivateEndpointConnectionRequest') @@ -432,6 +453,7 @@ def _create_or_update_initial( service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self._create_or_update_initial.metadata['url'], @@ -439,10 +461,14 @@ def _create_or_update_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) @@ -455,7 +481,7 @@ def _create_or_update_initial( return deserialized - _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace @@ -477,7 +503,7 @@ def begin_create_or_update( :type private_endpoint_connection_name: str :param private_endpoint_connection_request: :type private_endpoint_connection_request: - ~api_management_client.models.PrivateEndpointConnectionRequest + ~azure.mgmt.apimanagement.models.PrivateEndpointConnectionRequest :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -488,11 +514,13 @@ def begin_create_or_update( Retry-After header is present. :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.PrivateEndpointConnection] + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.PrivateEndpointConnection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateEndpointConnection"] lro_delay = kwargs.pop( 'polling_interval', @@ -505,6 +533,7 @@ def begin_create_or_update( service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, private_endpoint_connection_request=private_endpoint_connection_request, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -529,12 +558,11 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore - def _delete_initial( + def _delete_initial( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -547,18 +575,25 @@ def _delete_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request_initial( resource_group_name=resource_group_name, service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self._delete_initial.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202, 204]: @@ -568,11 +603,11 @@ def _delete_initial( if cls: return cls(pipeline_response, None, {}) - _delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace - def begin_delete( + def begin_delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -599,7 +634,8 @@ def begin_delete( :rtype: ~azure.core.polling.LROPoller[None] :raises: ~azure.core.exceptions.HttpResponseError """ - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType[None] lro_delay = kwargs.pop( 'polling_interval', @@ -611,6 +647,7 @@ def begin_delete( resource_group_name=resource_group_name, service_name=service_name, private_endpoint_connection_name=private_endpoint_connection_name, + api_version=api_version, cls=lambda x,y,z: x, **kwargs ) @@ -631,10 +668,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}'} # type: ignore + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateEndpointConnections/{privateEndpointConnectionName}"} # type: ignore @distributed_trace def list_private_link_resources( @@ -643,7 +679,7 @@ def list_private_link_resources( service_name: str, **kwargs: Any ) -> "_models.PrivateLinkResourceListResult": - """Description for Gets the private link resources. + """Gets the private link resources. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -651,7 +687,7 @@ def list_private_link_resources( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResourceListResult, or the result of cls(response) - :rtype: ~api_management_client.models.PrivateLinkResourceListResult + :rtype: ~azure.mgmt.apimanagement.models.PrivateLinkResourceListResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResourceListResult"] @@ -660,17 +696,24 @@ def list_private_link_resources( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_private_link_resources_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, service_name=service_name, + api_version=api_version, template_url=self.list_private_link_resources.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -685,7 +728,7 @@ def list_private_link_resources( return deserialized - list_private_link_resources.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources'} # type: ignore + list_private_link_resources.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources"} # type: ignore @distributed_trace @@ -696,7 +739,7 @@ def get_private_link_resource( private_link_sub_resource_name: str, **kwargs: Any ) -> "_models.PrivateLinkResource": - """Description for Gets the private link resources. + """Gets the private link resources. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -706,7 +749,7 @@ def get_private_link_resource( :type private_link_sub_resource_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PrivateLinkResource, or the result of cls(response) - :rtype: ~api_management_client.models.PrivateLinkResource + :rtype: ~azure.mgmt.apimanagement.models.PrivateLinkResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PrivateLinkResource"] @@ -715,18 +758,25 @@ def get_private_link_resource( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_private_link_resource_request( resource_group_name=resource_group_name, subscription_id=self._config.subscription_id, service_name=service_name, private_link_sub_resource_name=private_link_sub_resource_name, + api_version=api_version, template_url=self.get_private_link_resource.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -741,5 +791,5 @@ def get_private_link_resource( return deserialized - get_private_link_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources/{privateLinkSubResourceName}'} # type: ignore + get_private_link_resource.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/privateLinkResources/{privateLinkSubResourceName}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_api_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_product_api_operations.py index 11167ec108af..77c109764c80 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_by_product_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_by_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -81,10 +82,11 @@ def build_check_entity_exists_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -93,21 +95,21 @@ def build_check_entity_exists_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -120,10 +122,11 @@ def build_create_or_update_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -132,21 +135,21 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -159,10 +162,11 @@ def build_delete_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -171,21 +175,21 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -196,7 +200,7 @@ class ProductApiOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -238,17 +242,19 @@ def list_by_product( |
| 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 |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ApiCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ApiCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ApiCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -262,6 +268,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -277,6 +284,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -297,7 +305,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -311,7 +323,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis"} # type: ignore @distributed_trace def check_entity_exists( @@ -345,6 +357,8 @@ def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -352,12 +366,17 @@ def check_entity_exists( product_id=product_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -369,7 +388,7 @@ def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}"} # type: ignore @distributed_trace @@ -395,7 +414,7 @@ def create_or_update( :type api_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ApiContract, or the result of cls(response) - :rtype: ~api_management_client.models.ApiContract + :rtype: ~azure.mgmt.apimanagement.models.ApiContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ApiContract"] @@ -404,6 +423,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -411,12 +432,17 @@ def create_or_update( product_id=product_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -435,11 +461,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -470,6 +496,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -477,12 +505,17 @@ def delete( product_id=product_id, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -493,5 +526,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/apis/{apiId}"} # type: ignore 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 210babc16865..750e0e4d61a3 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_by_product_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_by_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -81,10 +82,11 @@ def build_check_entity_exists_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -93,21 +95,21 @@ def build_check_entity_exists_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -120,10 +122,11 @@ def build_create_or_update_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -132,21 +135,21 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -159,10 +162,11 @@ def build_delete_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -171,21 +175,21 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -196,7 +200,7 @@ class ProductGroupOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -234,17 +238,19 @@ def list_by_product( :param filter: | Field | Usage | Supported operators | Supported functions |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt | |
| displayName | filter | eq, ne | |
| - description | filter | eq, ne | |
. + description | filter | eq, ne | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GroupCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.GroupCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GroupCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -258,6 +264,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -273,6 +280,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -293,7 +301,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -307,7 +319,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups"} # type: ignore @distributed_trace def check_entity_exists( @@ -341,6 +353,8 @@ def check_entity_exists( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_check_entity_exists_request( resource_group_name=resource_group_name, @@ -348,12 +362,17 @@ def check_entity_exists( product_id=product_id, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.check_entity_exists.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -365,7 +384,7 @@ def check_entity_exists( return cls(pipeline_response, None, {}) return 200 <= response.status_code <= 299 - check_entity_exists.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} # type: ignore + check_entity_exists.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}"} # type: ignore @distributed_trace @@ -391,7 +410,7 @@ def create_or_update( :type group_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GroupContract, or the result of cls(response) - :rtype: ~api_management_client.models.GroupContract + :rtype: ~azure.mgmt.apimanagement.models.GroupContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupContract"] @@ -400,6 +419,8 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_create_or_update_request( resource_group_name=resource_group_name, @@ -407,12 +428,17 @@ def create_or_update( product_id=product_id, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.create_or_update.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -431,11 +457,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -466,6 +492,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -473,12 +501,17 @@ def delete( product_id=product_id, group_id=group_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -489,5 +522,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/groups/{groupId}"} # type: ignore 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 1033fc00cb01..d40aee1d5920 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,41 +39,42 @@ def build_list_by_service_request( tags: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if expand_groups is not None: - query_parameters['expandGroups'] = _SERIALIZER.query("expand_groups", expand_groups, 'bool') + _query_parameters['expandGroups'] = _SERIALIZER.query("expand_groups", expand_groups, 'bool') if tags is not None: - query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,10 +86,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -96,21 +98,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -122,10 +124,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -133,21 +136,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -163,12 +166,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -176,25 +179,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -212,12 +215,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -225,24 +228,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -259,10 +262,11 @@ def build_delete_request( delete_subscriptions: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -270,24 +274,24 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if delete_subscriptions is not None: - query_parameters['deleteSubscriptions'] = _SERIALIZER.query("delete_subscriptions", delete_subscriptions, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['deleteSubscriptions'] = _SERIALIZER.query("delete_subscriptions", delete_subscriptions, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -303,39 +307,40 @@ def build_list_by_tags_request( include_not_tagged_products: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if include_not_tagged_products is not None: - query_parameters['includeNotTaggedProducts'] = _SERIALIZER.query("include_not_tagged_products", include_not_tagged_products, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['includeNotTaggedProducts'] = _SERIALIZER.query("include_not_tagged_products", include_not_tagged_products, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -346,7 +351,7 @@ class ProductOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -385,22 +390,25 @@ def list_by_service( 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 | | |
. + endswith |
| state | filter | eq | |
| groups | expand | | |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :param expand_groups: When set to true, the response contains an array of groups that have visibility to the product. The default is false. :type expand_groups: bool - :param tags: Products which are part of a specific tag. + :param tags: Products which are part of a specific tag. Default value is None. :type tags: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ProductCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ProductCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ProductCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -413,6 +421,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -429,6 +438,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -451,7 +461,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -465,7 +479,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products"} # type: ignore @distributed_trace def get_entity_tag( @@ -495,18 +509,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -522,7 +543,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace @@ -544,7 +565,7 @@ def get( :type product_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ProductContract, or the result of cls(response) - :rtype: ~api_management_client.models.ProductContract + :rtype: ~azure.mgmt.apimanagement.models.ProductContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductContract"] @@ -553,18 +574,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -582,7 +610,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace @@ -605,13 +633,13 @@ def create_or_update( instance. :type product_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.ProductContract + :type parameters: ~azure.mgmt.apimanagement.models.ProductContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ProductContract, or the result of cls(response) - :rtype: ~api_management_client.models.ProductContract + :rtype: ~azure.mgmt.apimanagement.models.ProductContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductContract"] @@ -620,6 +648,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ProductContract') @@ -629,6 +658,7 @@ def create_or_update( service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -637,7 +667,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -661,7 +695,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace @@ -687,10 +721,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.ProductUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.ProductUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: ProductContract, or the result of cls(response) - :rtype: ~api_management_client.models.ProductContract + :rtype: ~azure.mgmt.apimanagement.models.ProductContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ProductContract"] @@ -699,6 +733,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'ProductUpdateParameters') @@ -708,6 +743,7 @@ def update( service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -716,7 +752,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -734,11 +774,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -760,6 +800,7 @@ def delete( response of the GET request or it should be * for unconditional update. :type if_match: str :param delete_subscriptions: Delete existing subscriptions associated with the product or not. + Default value is None. :type delete_subscriptions: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) @@ -772,12 +813,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, delete_subscriptions=delete_subscriptions, template_url=self.delete.metadata['url'], @@ -785,7 +829,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -796,7 +844,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}"} # type: ignore @distributed_trace @@ -823,19 +871,22 @@ def list_by_tags( |
| 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 |
. + Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param include_not_tagged_products: Include not tagged Products. + :param include_not_tagged_products: Include not tagged Products. Default value is None. :type include_not_tagged_products: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagResourceCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -848,6 +899,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -863,6 +915,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -884,7 +937,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -898,4 +955,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags'} # type: ignore + list_by_tags.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags"} # type: ignore 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 2528cc49c4e7..5eae92be0480 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,10 +33,11 @@ def build_list_by_product_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -44,21 +45,21 @@ def build_list_by_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -71,10 +72,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -83,21 +85,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -112,10 +114,11 @@ def build_get_request( format: Optional[Union[str, "_models.PolicyExportFormat"]] = "xml", **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -124,23 +127,23 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if format is not None: - query_parameters['format'] = _SERIALIZER.query("format", format, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['format'] = _SERIALIZER.query("format", format, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -157,12 +160,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -171,25 +174,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -206,10 +209,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -218,22 +222,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -244,7 +248,7 @@ class ProductPolicyOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -278,7 +282,7 @@ def list_by_product( :type product_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyCollection, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyCollection + :rtype: ~azure.mgmt.apimanagement.models.PolicyCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyCollection"] @@ -287,18 +291,25 @@ def list_by_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_product_request( resource_group_name=resource_group_name, service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -313,7 +324,7 @@ def list_by_product( return deserialized - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies"} # type: ignore @distributed_trace @@ -335,7 +346,7 @@ def get_entity_tag( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -347,6 +358,8 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, @@ -354,12 +367,17 @@ def get_entity_tag( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -375,7 +393,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore @distributed_trace @@ -398,12 +416,12 @@ def get( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName - :param format: Policy Export Format. - :type format: str or ~api_management_client.models.PolicyExportFormat + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName + :param format: Policy Export Format. Default value is "xml". + :type format: str or ~azure.mgmt.apimanagement.models.PolicyExportFormat :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -412,6 +430,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -419,13 +439,18 @@ def get( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, format=format, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -443,7 +468,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore @distributed_trace @@ -467,15 +492,15 @@ def create_or_update( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :param parameters: The policy contents to apply. - :type parameters: ~api_management_client.models.PolicyContract + :type parameters: ~azure.mgmt.apimanagement.models.PolicyContract :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PolicyContract, or the result of cls(response) - :rtype: ~api_management_client.models.PolicyContract + :rtype: ~azure.mgmt.apimanagement.models.PolicyContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PolicyContract"] @@ -484,6 +509,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PolicyContract') @@ -494,6 +520,7 @@ def create_or_update( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -502,7 +529,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -526,11 +557,11 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -549,7 +580,7 @@ def delete( instance. :type product_id: str :param policy_id: The identifier of the Policy. - :type policy_id: str or ~api_management_client.models.PolicyIdName + :type policy_id: str or ~azure.mgmt.apimanagement.models.PolicyIdName :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 @@ -564,6 +595,8 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, @@ -571,13 +604,18 @@ def delete( product_id=product_id, policy_id=policy_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -588,5 +626,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/policies/{policyId}"} # type: ignore 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 a8fb8cd3f6cb..06b021798216 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,7 +80,7 @@ class ProductSubscriptionsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -124,18 +125,20 @@ def list( 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 | | - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SubscriptionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.SubscriptionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.SubscriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -149,6 +152,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -164,6 +168,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -184,7 +189,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -198,4 +207,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/subscriptions"} # type: ignore 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 4ac1e1a88bd6..b1060ddf3e52 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,10 +33,11 @@ def build_list_by_service_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -44,21 +45,21 @@ def build_list_by_service_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -73,12 +74,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -86,23 +87,23 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -115,7 +116,7 @@ class QuotaByCounterKeysOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -152,7 +153,7 @@ def list_by_service( :type quota_counter_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterCollection, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterCollection + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterCollection"] @@ -161,18 +162,25 @@ def list_by_service( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_by_service_request( resource_group_name=resource_group_name, service_name=service_name, quota_counter_key=quota_counter_key, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -187,7 +195,7 @@ def list_by_service( return deserialized - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}"} # type: ignore @distributed_trace @@ -212,10 +220,10 @@ def update( as counter-key="@("b"+"a")" then it will be accessible by "ba" key. :type quota_counter_key: str :param parameters: The value of the quota counter to be applied to all quota counter periods. - :type parameters: ~api_management_client.models.QuotaCounterValueUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.QuotaCounterValueUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterCollection, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterCollection + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterCollection :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterCollection"] @@ -224,6 +232,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') @@ -233,6 +242,7 @@ def update( service_name=service_name, quota_counter_key=quota_counter_key, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.update.metadata['url'], @@ -240,7 +250,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -255,5 +269,5 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}"} # type: ignore 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 00621e347ba2..c2530d0d5448 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -34,10 +34,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -46,21 +47,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -76,12 +77,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,23 +91,23 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -119,7 +120,7 @@ class QuotaByPeriodKeysOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -159,7 +160,7 @@ def get( :type quota_period_key: str :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterContract, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterContract + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterContract"] @@ -168,6 +169,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -175,12 +178,17 @@ def get( quota_counter_key=quota_counter_key, quota_period_key=quota_period_key, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -195,7 +203,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}"} # type: ignore @distributed_trace @@ -222,10 +230,10 @@ def update( :param quota_period_key: Quota period key identifier. :type quota_period_key: str :param parameters: The value of the Quota counter to be applied on the specified period. - :type parameters: ~api_management_client.models.QuotaCounterValueUpdateContract + :type parameters: ~azure.mgmt.apimanagement.models.QuotaCounterValueUpdateContract :keyword callable cls: A custom type or function that will be passed the direct response :return: QuotaCounterContract, or the result of cls(response) - :rtype: ~api_management_client.models.QuotaCounterContract + :rtype: ~azure.mgmt.apimanagement.models.QuotaCounterContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.QuotaCounterContract"] @@ -234,6 +242,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'QuotaCounterValueUpdateContract') @@ -244,6 +253,7 @@ def update( quota_counter_key=quota_counter_key, quota_period_key=quota_period_key, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.update.metadata['url'], @@ -251,7 +261,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -266,5 +280,5 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/quotas/{quotaCounterKey}/periods/{quotaPeriodKey}"} # type: ignore 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 f31d8b3a042d..a6c24de89981 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_list_by_service_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -67,7 +68,7 @@ class RegionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -97,9 +98,11 @@ def list_by_service( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RegionListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.RegionListResult] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.RegionListResult] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.RegionListResult"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -112,6 +115,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_by_service.metadata['url'], ) request = _convert_request(request) @@ -123,6 +127,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -140,7 +145,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -154,4 +163,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/regions"} # type: ignore 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 37cdf036be34..7a9b07faecba 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -6,9 +7,9 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import datetime -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -17,7 +18,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,38 +38,39 @@ def build_list_by_api_request( orderby: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if orderby is not None: - query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,38 +86,39 @@ def build_list_by_user_request( orderby: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if orderby is not None: - query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -132,38 +134,39 @@ def build_list_by_operation_request( orderby: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if orderby is not None: - query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -179,38 +182,39 @@ def build_list_by_product_request( orderby: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if orderby is not None: - query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -225,36 +229,37 @@ def build_list_by_geo_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -270,38 +275,39 @@ def build_list_by_subscription_request( orderby: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if orderby is not None: - query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -318,39 +324,40 @@ def build_list_by_time_request( orderby: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if orderby is not None: - query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') - query_parameters['interval'] = _SERIALIZER.query("interval", interval, 'duration') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$orderby'] = _SERIALIZER.query("orderby", orderby, 'str') + _query_parameters['interval'] = _SERIALIZER.query("interval", interval, 'duration') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -365,36 +372,37 @@ def build_list_by_request_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -405,7 +413,7 @@ class ReportsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -439,17 +447,19 @@ def list_by_api( :type service_name: str :param filter: The filter to apply on the operation. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -462,6 +472,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -477,6 +488,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -498,7 +510,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -512,7 +528,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byApi"} # type: ignore @distributed_trace def list_by_user( @@ -545,17 +561,19 @@ def list_by_user(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -568,6 +586,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -583,6 +602,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -604,7 +624,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -618,7 +642,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_user.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser'} # type: ignore + list_by_user.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byUser"} # type: ignore @distributed_trace def list_by_operation( @@ -651,17 +675,19 @@ def list_by_operation(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -674,6 +700,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -689,6 +716,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -710,7 +738,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -724,7 +756,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation'} # type: ignore + list_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byOperation"} # type: ignore @distributed_trace def list_by_product( @@ -756,17 +788,19 @@ def list_by_product(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -779,6 +813,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -794,6 +829,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -815,7 +851,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -829,7 +869,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byProduct"} # type: ignore @distributed_trace def list_by_geo( @@ -861,15 +901,17 @@ def list_by_geo( serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -882,6 +924,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -896,6 +939,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -916,7 +960,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -930,7 +978,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_geo.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo'} # type: ignore + list_by_geo.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byGeo"} # type: ignore @distributed_trace def list_by_subscription( @@ -962,17 +1010,19 @@ def list_by_subscription(
| apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -985,6 +1035,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1000,6 +1051,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1021,7 +1073,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1035,7 +1091,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription'} # type: ignore + list_by_subscription.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/bySubscription"} # type: ignore @distributed_trace def list_by_time( @@ -1073,17 +1129,19 @@ def list_by_time( code can be used to convert TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). :type interval: ~datetime.timedelta - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param orderby: OData order by query option. + :param orderby: OData order by query option. Default value is None. :type orderby: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.ReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.ReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.ReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1096,6 +1154,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, interval=interval, top=top, @@ -1112,6 +1171,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, interval=interval, top=top, @@ -1134,7 +1194,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1148,7 +1212,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_time.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime'} # type: ignore + list_by_time.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byTime"} # type: ignore @distributed_trace def list_by_request( @@ -1172,16 +1236,18 @@ def list_by_request( |
| productId | filter | eq | |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter | eq | |
. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either RequestReportCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.RequestReportCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.RequestReportCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.RequestReportCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1194,6 +1260,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1208,6 +1275,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1228,7 +1296,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1242,4 +1314,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_request.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest'} # type: ignore + list_by_request.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/reports/byRequest"} # type: ignore 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 5bd986e52e0d..26d7d152b9f1 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -67,31 +68,32 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -106,36 +108,36 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -152,37 +154,37 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -195,7 +197,7 @@ class SignInSettingsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -234,17 +236,24 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -260,7 +269,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore @distributed_trace @@ -278,7 +287,7 @@ def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSigninSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSigninSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSigninSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSigninSettings"] @@ -287,17 +296,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -315,11 +331,11 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore @distributed_trace - def update( + def update( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -337,7 +353,7 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update Sign-In settings. - :type parameters: ~api_management_client.models.PortalSigninSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSigninSettings :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -349,6 +365,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSigninSettings') @@ -357,6 +374,7 @@ def update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -365,7 +383,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -376,7 +398,7 @@ def update( if cls: return cls(pipeline_response, None, {}) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore @distributed_trace @@ -395,13 +417,13 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.PortalSigninSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSigninSettings :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSigninSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSigninSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSigninSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSigninSettings"] @@ -410,6 +432,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSigninSettings') @@ -418,6 +441,7 @@ def create_or_update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -426,7 +450,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -441,5 +469,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin"} # type: ignore 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 f5a8cb49bfc3..8b5bf2da85ac 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,31 +32,32 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -67,31 +68,32 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -106,36 +108,36 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -152,37 +154,37 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -195,7 +197,7 @@ class SignUpSettingsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -234,17 +236,24 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -260,7 +269,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore @distributed_trace @@ -278,7 +287,7 @@ def get( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSignupSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSignupSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSignupSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSignupSettings"] @@ -287,17 +296,24 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -315,11 +331,11 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore @distributed_trace - def update( + def update( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -337,7 +353,7 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update Sign-Up settings. - :type parameters: ~api_management_client.models.PortalSignupSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSignupSettings :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -349,6 +365,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSignupSettings') @@ -357,6 +374,7 @@ def update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -365,7 +383,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -376,7 +398,7 @@ def update( if cls: return cls(pipeline_response, None, {}) - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore @distributed_trace @@ -395,13 +417,13 @@ def create_or_update( :param service_name: The name of the API Management service. :type service_name: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.PortalSignupSettings + :type parameters: ~azure.mgmt.apimanagement.models.PortalSignupSettings :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: PortalSignupSettings, or the result of cls(response) - :rtype: ~api_management_client.models.PortalSignupSettings + :rtype: ~azure.mgmt.apimanagement.models.PortalSignupSettings :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.PortalSignupSettings"] @@ -410,6 +432,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'PortalSignupSettings') @@ -418,6 +441,7 @@ def create_or_update( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -426,7 +450,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -441,5 +469,5 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup"} # type: ignore 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 6a8d273c3c0c..ed12f8cf806c 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,37 +37,38 @@ def build_list_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,10 +80,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -90,21 +92,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -116,10 +118,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -127,21 +130,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -159,12 +162,12 @@ def build_create_or_update_request( app_type: Optional[Union[str, "_models.AppType"]] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -172,29 +175,29 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if notify is not None: - query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if app_type is not None: - query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') + _query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -214,12 +217,12 @@ def build_update_request( app_type: Optional[Union[str, "_models.AppType"]] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -227,28 +230,28 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if notify is not None: - query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if app_type is not None: - query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') + _query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -264,10 +267,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -275,22 +279,22 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -302,10 +306,11 @@ def build_regenerate_primary_key_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -313,21 +318,21 @@ def build_regenerate_primary_key_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -339,10 +344,11 @@ def build_regenerate_secondary_key_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -350,21 +356,21 @@ def build_regenerate_secondary_key_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -376,10 +382,11 @@ def build_list_secrets_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -387,21 +394,21 @@ def build_list_secrets_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -412,7 +419,7 @@ class SubscriptionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -453,18 +460,20 @@ def list( 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 | | - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SubscriptionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.SubscriptionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.SubscriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -477,6 +486,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -491,6 +501,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -511,7 +522,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -525,7 +540,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions"} # type: ignore @distributed_trace def get_entity_tag( @@ -556,18 +571,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -583,7 +605,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace @@ -605,7 +627,7 @@ def get( :type sid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -614,18 +636,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -643,7 +672,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace @@ -668,22 +697,22 @@ def create_or_update( user and a product in API Management. :type sid: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.SubscriptionCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.SubscriptionCreateParameters :param notify: Notify change in Subscription State. * If false, do not send any email notification for change of state of subscription - * If true, send email notification of change of state of subscription. + * If true, send email notification of change of state of subscription. Default value is None. :type notify: bool :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -692,6 +721,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SubscriptionCreateParameters') @@ -701,6 +731,7 @@ def create_or_update( service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, notify=notify, @@ -711,7 +742,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -735,7 +770,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace @@ -763,19 +798,19 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.SubscriptionUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.SubscriptionUpdateParameters :param notify: Notify change in Subscription State. * If false, do not send any email notification for change of state of subscription - * If true, send email notification of change of state of subscription. + * If true, send email notification of change of state of subscription. Default value is None. :type notify: bool :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -784,6 +819,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SubscriptionUpdateParameters') @@ -793,6 +829,7 @@ def update( service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -803,7 +840,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -821,11 +862,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -856,19 +897,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -879,11 +927,11 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}"} # type: ignore @distributed_trace - def regenerate_primary_key( + def regenerate_primary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -910,18 +958,25 @@ def regenerate_primary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_primary_key_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.regenerate_primary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -932,11 +987,11 @@ def regenerate_primary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey'} # type: ignore + regenerate_primary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regeneratePrimaryKey"} # type: ignore @distributed_trace - def regenerate_secondary_key( + def regenerate_secondary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -963,18 +1018,25 @@ def regenerate_secondary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_secondary_key_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.regenerate_secondary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -985,7 +1047,7 @@ def regenerate_secondary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey'} # type: ignore + regenerate_secondary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/regenerateSecondaryKey"} # type: ignore @distributed_trace @@ -1007,7 +1069,7 @@ def list_secrets( :type sid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionKeysContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionKeysContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionKeysContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionKeysContract"] @@ -1016,18 +1078,25 @@ def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1045,5 +1114,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets"} # type: ignore 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 963a0651f991..a891084e010b 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -39,10 +39,11 @@ def build_list_by_operation_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -51,27 +52,27 @@ def build_list_by_operation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -85,10 +86,11 @@ def build_get_entity_state_by_operation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -98,21 +100,21 @@ def build_get_entity_state_by_operation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -126,10 +128,11 @@ def build_get_by_operation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -139,21 +142,21 @@ def build_get_by_operation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -167,10 +170,11 @@ def build_assign_to_operation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -180,21 +184,21 @@ def build_assign_to_operation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -208,10 +212,11 @@ def build_detach_from_operation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -221,21 +226,21 @@ def build_detach_from_operation_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -251,10 +256,11 @@ def build_list_by_api_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -262,27 +268,27 @@ def build_list_by_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -295,10 +301,11 @@ def build_get_entity_state_by_api_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -307,21 +314,21 @@ def build_get_entity_state_by_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -334,10 +341,11 @@ def build_get_by_api_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -346,21 +354,21 @@ def build_get_by_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -373,10 +381,11 @@ def build_assign_to_api_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -385,21 +394,21 @@ def build_assign_to_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -412,10 +421,11 @@ def build_detach_from_api_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -424,21 +434,21 @@ def build_detach_from_api_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -454,10 +464,11 @@ def build_list_by_product_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -465,27 +476,27 @@ def build_list_by_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -498,10 +509,11 @@ def build_get_entity_state_by_product_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -510,21 +522,21 @@ def build_get_entity_state_by_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -537,10 +549,11 @@ def build_get_by_product_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -549,21 +562,21 @@ def build_get_by_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -576,10 +589,11 @@ def build_assign_to_product_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -588,21 +602,21 @@ def build_assign_to_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -615,10 +629,11 @@ def build_detach_from_product_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -627,21 +642,21 @@ def build_detach_from_product_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -657,39 +672,40 @@ def build_list_by_service_request( scope: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if scope is not None: - query_parameters['scope'] = _SERIALIZER.query("scope", scope, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['scope'] = _SERIALIZER.query("scope", scope, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -701,10 +717,11 @@ def build_get_entity_state_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -712,21 +729,21 @@ def build_get_entity_state_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -738,10 +755,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -749,21 +767,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -779,12 +797,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -792,25 +810,25 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -828,12 +846,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -841,24 +859,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -874,10 +892,11 @@ def build_delete_request( if_match: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -885,33 +904,33 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) -class TagOperations(object): +class TagOperations(object): # pylint: disable=too-many-public-methods """TagOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -953,17 +972,20 @@ def list_by_operation( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -978,6 +1000,7 @@ def prepare_request(next_link=None): api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -994,6 +1017,7 @@ def prepare_request(next_link=None): api_id=api_id, operation_id=operation_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1014,7 +1038,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1028,7 +1056,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags'} # type: ignore + list_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags"} # type: ignore @distributed_trace def get_entity_state_by_operation( @@ -1065,6 +1093,8 @@ def get_entity_state_by_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_by_operation_request( resource_group_name=resource_group_name, @@ -1073,12 +1103,17 @@ def get_entity_state_by_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state_by_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1094,7 +1129,7 @@ def get_entity_state_by_operation( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + get_entity_state_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1123,7 +1158,7 @@ def get_by_operation( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1132,6 +1167,8 @@ def get_by_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_operation_request( resource_group_name=resource_group_name, @@ -1140,12 +1177,17 @@ def get_by_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1163,7 +1205,7 @@ def get_by_operation( return deserialized - get_by_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + get_by_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1192,7 +1234,7 @@ def assign_to_operation( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1201,6 +1243,8 @@ def assign_to_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_assign_to_operation_request( resource_group_name=resource_group_name, @@ -1209,12 +1253,17 @@ def assign_to_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.assign_to_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -1233,11 +1282,11 @@ def assign_to_operation( return deserialized - assign_to_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + assign_to_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace - def detach_from_operation( + def detach_from_operation( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -1271,6 +1320,8 @@ def detach_from_operation( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_detach_from_operation_request( resource_group_name=resource_group_name, @@ -1279,12 +1330,17 @@ def detach_from_operation( operation_id=operation_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.detach_from_operation.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -1295,7 +1351,7 @@ def detach_from_operation( if cls: return cls(pipeline_response, None, {}) - detach_from_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}'} # type: ignore + detach_from_operation.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1321,17 +1377,20 @@ def list_by_api( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1345,6 +1404,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1360,6 +1420,7 @@ def prepare_request(next_link=None): service_name=service_name, api_id=api_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1380,7 +1441,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1394,7 +1459,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags'} # type: ignore + list_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags"} # type: ignore @distributed_trace def get_entity_state_by_api( @@ -1427,6 +1492,8 @@ def get_entity_state_by_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_by_api_request( resource_group_name=resource_group_name, @@ -1434,12 +1501,17 @@ def get_entity_state_by_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state_by_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1455,7 +1527,7 @@ def get_entity_state_by_api( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + get_entity_state_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1480,7 +1552,7 @@ def get_by_api( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1489,6 +1561,8 @@ def get_by_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_api_request( resource_group_name=resource_group_name, @@ -1496,12 +1570,17 @@ def get_by_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1519,7 +1598,7 @@ def get_by_api( return deserialized - get_by_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + get_by_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1544,7 +1623,7 @@ def assign_to_api( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1553,6 +1632,8 @@ def assign_to_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_assign_to_api_request( resource_group_name=resource_group_name, @@ -1560,12 +1641,17 @@ def assign_to_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.assign_to_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -1589,11 +1675,11 @@ def assign_to_api( return deserialized - assign_to_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + assign_to_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace - def detach_from_api( + def detach_from_api( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -1623,6 +1709,8 @@ def detach_from_api( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_detach_from_api_request( resource_group_name=resource_group_name, @@ -1630,12 +1718,17 @@ def detach_from_api( api_id=api_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.detach_from_api.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -1646,7 +1739,7 @@ def detach_from_api( if cls: return cls(pipeline_response, None, {}) - detach_from_api.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}'} # type: ignore + detach_from_api.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1672,17 +1765,20 @@ def list_by_product( :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 |
. + filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
. Default + value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -1696,6 +1792,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1711,6 +1808,7 @@ def prepare_request(next_link=None): service_name=service_name, product_id=product_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -1731,7 +1829,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1745,7 +1847,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags'} # type: ignore + list_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags"} # type: ignore @distributed_trace def get_entity_state_by_product( @@ -1778,6 +1880,8 @@ def get_entity_state_by_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_by_product_request( resource_group_name=resource_group_name, @@ -1785,12 +1889,17 @@ def get_entity_state_by_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state_by_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1806,7 +1915,7 @@ def get_entity_state_by_product( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + get_entity_state_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1831,7 +1940,7 @@ def get_by_product( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1840,6 +1949,8 @@ def get_by_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_by_product_request( resource_group_name=resource_group_name, @@ -1847,12 +1958,17 @@ def get_by_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_by_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -1870,7 +1986,7 @@ def get_by_product( return deserialized - get_by_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + get_by_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -1895,7 +2011,7 @@ def assign_to_product( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -1904,6 +2020,8 @@ def assign_to_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_assign_to_product_request( resource_group_name=resource_group_name, @@ -1911,12 +2029,17 @@ def assign_to_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.assign_to_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -1935,11 +2058,11 @@ def assign_to_product( return deserialized - assign_to_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + assign_to_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace - def detach_from_product( + def detach_from_product( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -1969,6 +2092,8 @@ def detach_from_product( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_detach_from_product_request( resource_group_name=resource_group_name, @@ -1976,12 +2101,17 @@ def detach_from_product( product_id=product_id, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.detach_from_product.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -1992,7 +2122,7 @@ def detach_from_product( if cls: return cls(pipeline_response, None, {}) - detach_from_product.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}'} # type: ignore + detach_from_product.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}"} # type: ignore @distributed_trace @@ -2016,19 +2146,21 @@ def list_by_service( 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 - |
. + |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param scope: Scope like 'apis', 'products' or 'apis/{apiId}. + :param scope: Scope like 'apis', 'products' or 'apis/{apiId}. Default value is None. :type scope: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -2041,6 +2173,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -2056,6 +2189,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -2077,7 +2211,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -2091,7 +2229,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags"} # type: ignore @distributed_trace def get_entity_state( @@ -2120,18 +2258,25 @@ def get_entity_state( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_state_request( resource_group_name=resource_group_name, service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_state.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -2147,7 +2292,7 @@ def get_entity_state( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + get_entity_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace @@ -2168,7 +2313,7 @@ def get( :type tag_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -2177,18 +2322,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -2206,7 +2358,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace @@ -2228,13 +2380,13 @@ def create_or_update( :param tag_id: Tag identifier. Must be unique in the current API Management service instance. :type tag_id: str :param parameters: Create parameters. - :type parameters: ~api_management_client.models.TagCreateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.TagCreateUpdateParameters :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -2243,6 +2395,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'TagCreateUpdateParameters') @@ -2252,6 +2405,7 @@ def create_or_update( service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, if_match=if_match, @@ -2260,7 +2414,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -2284,7 +2442,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace @@ -2309,10 +2467,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.TagCreateUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.TagCreateUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: TagContract, or the result of cls(response) - :rtype: ~api_management_client.models.TagContract + :rtype: ~azure.mgmt.apimanagement.models.TagContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TagContract"] @@ -2321,6 +2479,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'TagCreateUpdateParameters') @@ -2330,6 +2489,7 @@ def update( service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -2338,7 +2498,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -2356,11 +2520,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -2390,19 +2554,26 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, tag_id=tag_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, template_url=self.delete.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -2413,5 +2584,5 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}"} # type: ignore 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 2d7cae70b46c..d92942d7e69e 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -36,37 +36,38 @@ def build_list_by_service_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -77,7 +78,7 @@ class TagResourceOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -122,18 +123,20 @@ def list_by_service( 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 | |
. + | filter | eq | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TagResourceCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TagResourceCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TagResourceCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TagResourceCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -146,6 +149,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -160,6 +164,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -180,7 +185,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -194,4 +203,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tagResources"} # type: ignore 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 b9ffd2f72bca..20268ca725db 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -32,10 +32,11 @@ def build_regenerate_primary_key_request( access_name: Union[str, "_models.AccessIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -43,21 +44,21 @@ def build_regenerate_primary_key_request( "accessName": _SERIALIZER.url("access_name", access_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -69,10 +70,11 @@ def build_regenerate_secondary_key_request( access_name: Union[str, "_models.AccessIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -80,21 +82,21 @@ def build_regenerate_secondary_key_request( "accessName": _SERIALIZER.url("access_name", access_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -105,7 +107,7 @@ class TenantAccessGitOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -121,7 +123,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config @distributed_trace - def regenerate_primary_key( + def regenerate_primary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -135,7 +137,7 @@ def regenerate_primary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -147,18 +149,25 @@ def regenerate_primary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_primary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_primary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -169,11 +178,11 @@ def regenerate_primary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey'} # type: ignore + regenerate_primary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regeneratePrimaryKey"} # type: ignore @distributed_trace - def regenerate_secondary_key( + def regenerate_secondary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -187,7 +196,7 @@ def regenerate_secondary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -199,18 +208,25 @@ def regenerate_secondary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_secondary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_secondary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -221,5 +237,5 @@ def regenerate_secondary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey'} # type: ignore + regenerate_secondary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/regenerateSecondaryKey"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_tenant_access_operations.py index 67212b4c8113..e62d2a55366e 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -35,33 +35,34 @@ def build_list_by_service_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -73,10 +74,11 @@ def build_get_entity_tag_request( access_name: Union[str, "_models.AccessIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -84,21 +86,21 @@ def build_get_entity_tag_request( "accessName": _SERIALIZER.url("access_name", access_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -110,10 +112,11 @@ def build_get_request( access_name: Union[str, "_models.AccessIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -121,21 +124,21 @@ def build_get_request( "accessName": _SERIALIZER.url("access_name", access_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -151,12 +154,12 @@ def build_create_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -164,24 +167,24 @@ def build_create_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -199,12 +202,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -212,24 +215,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -243,10 +246,11 @@ def build_regenerate_primary_key_request( access_name: Union[str, "_models.AccessIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -254,21 +258,21 @@ def build_regenerate_primary_key_request( "accessName": _SERIALIZER.url("access_name", access_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -280,10 +284,11 @@ def build_regenerate_secondary_key_request( access_name: Union[str, "_models.AccessIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -291,21 +296,21 @@ def build_regenerate_secondary_key_request( "accessName": _SERIALIZER.url("access_name", access_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -317,10 +322,11 @@ def build_list_secrets_request( access_name: Union[str, "_models.AccessIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -328,21 +334,21 @@ def build_list_secrets_request( "accessName": _SERIALIZER.url("access_name", access_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -353,7 +359,7 @@ class TenantAccessOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -382,14 +388,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: Not used. + :param filter: Not used. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either AccessInformationCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.AccessInformationCollection] + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.AccessInformationCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -402,6 +411,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=self.list_by_service.metadata['url'], ) @@ -414,6 +424,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=next_link, ) @@ -432,7 +443,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -446,7 +461,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant"} # type: ignore @distributed_trace def get_entity_tag( @@ -463,7 +478,7 @@ def get_entity_tag( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: bool, or the result of cls(response) :rtype: bool @@ -475,18 +490,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -502,7 +524,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace @@ -520,10 +542,10 @@ def get( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] @@ -532,18 +554,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -561,7 +590,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace @@ -581,15 +610,15 @@ def create( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Parameters supplied to retrieve the Tenant Access Information. - :type parameters: ~api_management_client.models.AccessInformationCreateParameters + :type parameters: ~azure.mgmt.apimanagement.models.AccessInformationCreateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] @@ -598,6 +627,7 @@ def create( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AccessInformationCreateParameters') @@ -607,6 +637,7 @@ def create( service_name=service_name, access_name=access_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -615,7 +646,11 @@ def create( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -633,7 +668,7 @@ def create( return deserialized - create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + create.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace @@ -653,15 +688,15 @@ def update( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :param if_match: ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Parameters supplied to retrieve the Tenant Access Information. - :type parameters: ~api_management_client.models.AccessInformationUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.AccessInformationUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationContract"] @@ -670,6 +705,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'AccessInformationUpdateParameters') @@ -679,6 +715,7 @@ def update( service_name=service_name, access_name=access_name, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -687,7 +724,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -705,11 +746,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}"} # type: ignore @distributed_trace - def regenerate_primary_key( + def regenerate_primary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -723,7 +764,7 @@ def regenerate_primary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -735,18 +776,25 @@ def regenerate_primary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_primary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_primary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -757,11 +805,11 @@ def regenerate_primary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_primary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey'} # type: ignore + regenerate_primary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regeneratePrimaryKey"} # type: ignore @distributed_trace - def regenerate_secondary_key( + def regenerate_secondary_key( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -775,7 +823,7 @@ def regenerate_secondary_key( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -787,18 +835,25 @@ def regenerate_secondary_key( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_regenerate_secondary_key_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.regenerate_secondary_key.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -809,7 +864,7 @@ def regenerate_secondary_key( if cls: return cls(pipeline_response, None, {}) - regenerate_secondary_key.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey'} # type: ignore + regenerate_secondary_key.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/regenerateSecondaryKey"} # type: ignore @distributed_trace @@ -827,10 +882,10 @@ def list_secrets( :param service_name: The name of the API Management service. :type service_name: str :param access_name: The identifier of the Access configuration. - :type access_name: str or ~api_management_client.models.AccessIdName + :type access_name: str or ~azure.mgmt.apimanagement.models.AccessIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: AccessInformationSecretsContract, or the result of cls(response) - :rtype: ~api_management_client.models.AccessInformationSecretsContract + :rtype: ~azure.mgmt.apimanagement.models.AccessInformationSecretsContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.AccessInformationSecretsContract"] @@ -839,18 +894,25 @@ def list_secrets( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_list_secrets_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, access_name=access_name, + api_version=api_version, template_url=self.list_secrets.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -868,5 +930,5 @@ def list_secrets( return deserialized - list_secrets.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets'} # type: ignore + list_secrets.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets"} # type: ignore 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 bf95e864c0f7..a9e66d5623c0 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -17,7 +18,6 @@ from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat from azure.mgmt.core.polling.arm_polling import ARMPolling -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,12 +38,12 @@ def build_deploy_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -51,23 +51,23 @@ def build_deploy_request_initial( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -84,12 +84,12 @@ def build_save_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -97,23 +97,23 @@ def build_save_request_initial( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -130,12 +130,12 @@ def build_validate_request_initial( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -143,23 +143,23 @@ def build_validate_request_initial( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -173,10 +173,11 @@ def build_get_sync_state_request( configuration_name: Union[str, "_models.ConfigurationIdName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -184,21 +185,21 @@ def build_get_sync_state_request( "configurationName": _SERIALIZER.url("configuration_name", configuration_name, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -209,7 +210,7 @@ class TenantConfigurationOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -238,6 +239,7 @@ def _deploy_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DeployConfigurationParameters') @@ -247,6 +249,7 @@ def _deploy_initial( service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._deploy_initial.metadata['url'], @@ -254,7 +257,11 @@ def _deploy_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -270,7 +277,7 @@ def _deploy_initial( return deserialized - _deploy_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy'} # type: ignore + _deploy_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy"} # type: ignore @distributed_trace @@ -290,9 +297,9 @@ def begin_deploy( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :param parameters: Deploy Configuration parameters. - :type parameters: ~api_management_client.models.DeployConfigurationParameters + :type parameters: ~azure.mgmt.apimanagement.models.DeployConfigurationParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -303,11 +310,12 @@ def begin_deploy( Retry-After header is present. :return: An instance of LROPoller that returns either OperationResultContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.OperationResultContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.OperationResultContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -320,6 +328,7 @@ def begin_deploy( service_name=service_name, configuration_name=configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -344,10 +353,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_deploy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy'} # type: ignore + begin_deploy.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/deploy"} # type: ignore def _save_initial( self, @@ -363,6 +371,7 @@ def _save_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'SaveConfigurationParameter') @@ -372,6 +381,7 @@ def _save_initial( service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._save_initial.metadata['url'], @@ -379,7 +389,11 @@ def _save_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -395,7 +409,7 @@ def _save_initial( return deserialized - _save_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save'} # type: ignore + _save_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save"} # type: ignore @distributed_trace @@ -415,9 +429,9 @@ def begin_save( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :param parameters: Save Configuration parameters. - :type parameters: ~api_management_client.models.SaveConfigurationParameter + :type parameters: ~azure.mgmt.apimanagement.models.SaveConfigurationParameter :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -428,11 +442,12 @@ def begin_save( Retry-After header is present. :return: An instance of LROPoller that returns either OperationResultContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.OperationResultContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.OperationResultContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -445,6 +460,7 @@ def begin_save( service_name=service_name, configuration_name=configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -469,10 +485,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_save.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save'} # type: ignore + begin_save.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/save"} # type: ignore def _validate_initial( self, @@ -488,6 +503,7 @@ def _validate_initial( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'DeployConfigurationParameters') @@ -497,6 +513,7 @@ def _validate_initial( service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, content_type=content_type, json=_json, template_url=self._validate_initial.metadata['url'], @@ -504,7 +521,11 @@ def _validate_initial( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 202]: @@ -520,7 +541,7 @@ def _validate_initial( return deserialized - _validate_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate'} # type: ignore + _validate_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate"} # type: ignore @distributed_trace @@ -540,9 +561,9 @@ def begin_validate( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :param parameters: Validate Configuration parameters. - :type parameters: ~api_management_client.models.DeployConfigurationParameters + :type parameters: ~azure.mgmt.apimanagement.models.DeployConfigurationParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this @@ -553,11 +574,12 @@ def begin_validate( Retry-After header is present. :return: An instance of LROPoller that returns either OperationResultContract or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~api_management_client.models.OperationResultContract] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.apimanagement.models.OperationResultContract] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] - polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.PollingMethod] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationResultContract"] lro_delay = kwargs.pop( 'polling_interval', @@ -570,6 +592,7 @@ def begin_validate( service_name=service_name, configuration_name=configuration_name, parameters=parameters, + api_version=api_version, content_type=content_type, cls=lambda x,y,z: x, **kwargs @@ -594,10 +617,9 @@ def get_long_running_output(pipeline_response): client=self._client, deserialization_callback=get_long_running_output ) - else: - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - begin_validate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate'} # type: ignore + begin_validate.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/validate"} # type: ignore @distributed_trace def get_sync_state( @@ -615,10 +637,10 @@ def get_sync_state( :param service_name: The name of the API Management service. :type service_name: str :param configuration_name: The identifier of the Git Configuration Operation. - :type configuration_name: str or ~api_management_client.models.ConfigurationIdName + :type configuration_name: str or ~azure.mgmt.apimanagement.models.ConfigurationIdName :keyword callable cls: A custom type or function that will be passed the direct response :return: TenantConfigurationSyncStateContract, or the result of cls(response) - :rtype: ~api_management_client.models.TenantConfigurationSyncStateContract + :rtype: ~azure.mgmt.apimanagement.models.TenantConfigurationSyncStateContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantConfigurationSyncStateContract"] @@ -627,18 +649,25 @@ def get_sync_state( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_sync_state_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, configuration_name=configuration_name, + api_version=api_version, template_url=self.get_sync_state.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -653,5 +682,5 @@ def get_sync_state( return deserialized - get_sync_state.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState'} # type: ignore + get_sync_state.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{configurationName}/syncState"} # type: ignore 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 index 240f808226a3..24075b3b8197 100644 --- 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -34,33 +34,34 @@ def build_list_by_service_request( filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -72,10 +73,11 @@ def build_get_request( settings_type: Union[str, "_models.SettingsTypeName"], **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -83,21 +85,21 @@ def build_get_request( "settingsType": _SERIALIZER.url("settings_type", settings_type, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -108,7 +110,7 @@ class TenantSettingsOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -137,14 +139,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: Not used. + :param filter: Not used. Default value is None. :type filter: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either TenantSettingsCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.TenantSettingsCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.TenantSettingsCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -157,6 +161,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=self.list_by_service.metadata['url'], ) @@ -169,6 +174,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, template_url=next_link, ) @@ -187,7 +193,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -201,7 +211,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings"} # type: ignore @distributed_trace def get( @@ -218,10 +228,10 @@ def get( :param service_name: The name of the API Management service. :type service_name: str :param settings_type: The identifier of the settings. - :type settings_type: str or ~api_management_client.models.SettingsTypeName + :type settings_type: str or ~azure.mgmt.apimanagement.models.SettingsTypeName :keyword callable cls: A custom type or function that will be passed the direct response :return: TenantSettingsContract, or the result of cls(response) - :rtype: ~api_management_client.models.TenantSettingsContract + :rtype: ~azure.mgmt.apimanagement.models.TenantSettingsContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.TenantSettingsContract"] @@ -230,18 +240,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, settings_type=settings_type, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -259,5 +276,5 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/settings/{settingsType}"} # type: ignore diff --git a/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py b/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_user_confirmation_password_operations.py index 2855d8e39ae5..90b1cfdf0cac 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse @@ -15,7 +16,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -34,10 +34,11 @@ def build_send_request( app_type: Optional[Union[str, "_models.AppType"]] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -45,23 +46,23 @@ def build_send_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if app_type is not None: - query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') + _query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -72,7 +73,7 @@ class UserConfirmationPasswordOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -88,7 +89,7 @@ def __init__(self, client, config, serializer, deserializer): self._config = config @distributed_trace - def send( + def send( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -106,7 +107,7 @@ def send( :type user_id: str :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -118,19 +119,26 @@ def send( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_send_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, app_type=app_type, template_url=self.send.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [204]: @@ -141,5 +149,5 @@ def send( if cls: return cls(pipeline_response, None, {}) - send.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send'} # type: ignore + send.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send"} # type: ignore 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 258e61fc4721..68b8359c5c2f 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -79,7 +80,7 @@ class UserGroupOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -119,17 +120,19 @@ def list( filter | ge, le, eq, ne, gt, lt | substringof, contains, 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 |
. + endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either GroupCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.GroupCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.GroupCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.GroupCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -143,6 +146,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -158,6 +162,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -178,7 +183,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -192,4 +201,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups"} # type: ignore 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 6b528b83a6bc..7f0a223fbc22 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -33,10 +33,11 @@ def build_list_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -44,21 +45,21 @@ def build_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -69,7 +70,7 @@ class UserIdentitiesOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -103,9 +104,11 @@ def list( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either UserIdentityCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.UserIdentityCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.UserIdentityCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserIdentityCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -119,6 +122,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.list.metadata['url'], ) request = _convert_request(request) @@ -131,6 +135,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=next_link, ) request = _convert_request(request) @@ -148,7 +153,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -162,4 +171,4 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities"} # type: ignore 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 5a8c2937b9a4..d3650988c688 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar, Union + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -38,39 +38,40 @@ def build_list_by_service_request( expand_groups: Optional[bool] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) if expand_groups is not None: - query_parameters['expandGroups'] = _SERIALIZER.query("expand_groups", expand_groups, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['expandGroups'] = _SERIALIZER.query("expand_groups", expand_groups, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -82,10 +83,11 @@ def build_get_entity_tag_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -93,21 +95,21 @@ def build_get_entity_tag_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="HEAD", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -119,10 +121,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -130,21 +133,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -161,12 +164,12 @@ def build_create_or_update_request( if_match: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -174,27 +177,27 @@ def build_create_or_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if notify is not None: - query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if if_match is not None: - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PUT", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -212,12 +215,12 @@ def build_update_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -225,24 +228,24 @@ def build_update_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="PATCH", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -261,10 +264,11 @@ def build_delete_request( app_type: Optional[Union[str, "_models.AppType"]] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -272,28 +276,28 @@ def build_delete_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if delete_subscriptions is not None: - query_parameters['deleteSubscriptions'] = _SERIALIZER.query("delete_subscriptions", delete_subscriptions, 'bool') + _query_parameters['deleteSubscriptions'] = _SERIALIZER.query("delete_subscriptions", delete_subscriptions, 'bool') if notify is not None: - query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['notify'] = _SERIALIZER.query("notify", notify, 'bool') + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') if app_type is not None: - query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') + _query_parameters['appType'] = _SERIALIZER.query("app_type", app_type, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['If-Match'] = _SERIALIZER.header("if_match", if_match, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="DELETE", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -305,10 +309,11 @@ def build_generate_sso_url_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -316,21 +321,21 @@ def build_generate_sso_url_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -345,12 +350,12 @@ def build_get_shared_access_token_request( content: Any = None, **kwargs: Any ) -> HttpRequest: + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', None) # type: Optional[str] - api_version = "2021-08-01" accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -358,23 +363,23 @@ def build_get_shared_access_token_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] if content_type is not None: - header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="POST", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, json=json, content=content, **kwargs @@ -387,7 +392,7 @@ class UserOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -427,19 +432,21 @@ def list_by_service( |
| 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 | | |
. + |
| groups | expand | | |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int - :param expand_groups: Detailed Group in response. + :param expand_groups: Detailed Group in response. Default value is None. :type expand_groups: bool :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either UserCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.UserCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.UserCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.UserCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -452,6 +459,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -467,6 +475,7 @@ def prepare_request(next_link=None): resource_group_name=resource_group_name, service_name=service_name, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -488,7 +497,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -502,7 +515,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list_by_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users'} # type: ignore + list_by_service.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users"} # type: ignore @distributed_trace def get_entity_tag( @@ -531,18 +544,25 @@ def get_entity_tag( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_entity_tag_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get_entity_tag.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -558,7 +578,7 @@ def get_entity_tag( return cls(pipeline_response, None, response_headers) return 200 <= response.status_code <= 299 - get_entity_tag.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + get_entity_tag.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace @@ -579,7 +599,7 @@ def get( :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -588,18 +608,25 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -617,7 +644,7 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace @@ -640,15 +667,15 @@ def create_or_update( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :param parameters: Create or update parameters. - :type parameters: ~api_management_client.models.UserCreateParameters - :param notify: Send an Email notification to the User. + :type parameters: ~azure.mgmt.apimanagement.models.UserCreateParameters + :param notify: Send an Email notification to the User. Default value is None. :type notify: bool :param if_match: ETag of the Entity. Not required when creating an entity, but required when - updating an entity. + updating an entity. Default value is None. :type if_match: str :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -657,6 +684,7 @@ def create_or_update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'UserCreateParameters') @@ -666,6 +694,7 @@ def create_or_update( service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, notify=notify, @@ -675,7 +704,11 @@ def create_or_update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 201]: @@ -699,7 +732,7 @@ def create_or_update( return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace @@ -724,10 +757,10 @@ def update( response of the GET request or it should be * for unconditional update. :type if_match: str :param parameters: Update parameters. - :type parameters: ~api_management_client.models.UserUpdateParameters + :type parameters: ~azure.mgmt.apimanagement.models.UserUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: UserContract, or the result of cls(response) - :rtype: ~api_management_client.models.UserContract + :rtype: ~azure.mgmt.apimanagement.models.UserContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserContract"] @@ -736,6 +769,7 @@ def update( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'UserUpdateParameters') @@ -745,6 +779,7 @@ def update( service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, if_match=if_match, json=_json, @@ -753,7 +788,11 @@ def update( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -771,11 +810,11 @@ def update( return deserialized - update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace - def delete( + def delete( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, service_name: str, @@ -797,13 +836,14 @@ def delete( :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 delete_subscriptions: Whether to delete user's subscription or not. + :param delete_subscriptions: Whether to delete user's subscription or not. Default value is + None. :type delete_subscriptions: bool - :param notify: Send an Account Closed Email notification to the User. + :param notify: Send an Account Closed Email notification to the User. Default value is None. :type notify: bool :param app_type: Determines the type of application which send the create user request. Default is legacy publisher portal. - :type app_type: str or ~api_management_client.models.AppType + :type app_type: str or ~azure.mgmt.apimanagement.models.AppType :keyword callable cls: A custom type or function that will be passed the direct response :return: None, or the result of cls(response) :rtype: None @@ -815,12 +855,15 @@ def delete( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_delete_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, if_match=if_match, delete_subscriptions=delete_subscriptions, notify=notify, @@ -830,7 +873,11 @@ def delete( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200, 204]: @@ -841,7 +888,7 @@ def delete( if cls: return cls(pipeline_response, None, {}) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}'} # type: ignore + delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}"} # type: ignore @distributed_trace @@ -863,7 +910,7 @@ def generate_sso_url( :type user_id: str :keyword callable cls: A custom type or function that will be passed the direct response :return: GenerateSsoUrlResult, or the result of cls(response) - :rtype: ~api_management_client.models.GenerateSsoUrlResult + :rtype: ~azure.mgmt.apimanagement.models.GenerateSsoUrlResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.GenerateSsoUrlResult"] @@ -872,18 +919,25 @@ def generate_sso_url( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_generate_sso_url_request( resource_group_name=resource_group_name, service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.generate_sso_url.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -898,7 +952,7 @@ def generate_sso_url( return deserialized - generate_sso_url.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl'} # type: ignore + generate_sso_url.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl"} # type: ignore @distributed_trace @@ -919,10 +973,10 @@ def get_shared_access_token( :param user_id: User identifier. Must be unique in the current API Management service instance. :type user_id: str :param parameters: Create Authorization Token parameters. - :type parameters: ~api_management_client.models.UserTokenParameters + :type parameters: ~azure.mgmt.apimanagement.models.UserTokenParameters :keyword callable cls: A custom type or function that will be passed the direct response :return: UserTokenResult, or the result of cls(response) - :rtype: ~api_management_client.models.UserTokenResult + :rtype: ~azure.mgmt.apimanagement.models.UserTokenResult :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.UserTokenResult"] @@ -931,6 +985,7 @@ def get_shared_access_token( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] _json = self._serialize.body(parameters, 'UserTokenParameters') @@ -940,6 +995,7 @@ def get_shared_access_token( service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, content_type=content_type, json=_json, template_url=self.get_shared_access_token.metadata['url'], @@ -947,7 +1003,11 @@ def get_shared_access_token( request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -962,5 +1022,5 @@ def get_shared_access_token( return deserialized - get_shared_access_token.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token'} # type: ignore + get_shared_access_token.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token"} # type: ignore 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 804a840b6405..729a9af97f68 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -5,9 +6,9 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -import functools -from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar -import warnings +from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + +from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.paging import ItemPaged @@ -16,7 +17,6 @@ from azure.core.rest import HttpRequest from azure.core.tracing.decorator import distributed_trace from azure.mgmt.core.exceptions import ARMErrorFormat -from msrest import Serializer from .. import models as _models from .._vendor import _convert_request, _format_url_section @@ -37,10 +37,11 @@ def build_list_request( skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -48,27 +49,27 @@ def build_list_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] if filter is not None: - query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') + _query_parameters['$filter'] = _SERIALIZER.query("filter", filter, 'str') if top is not None: - query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) + _query_parameters['$top'] = _SERIALIZER.query("top", top, 'int', minimum=1) if skip is not None: - query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['$skip'] = _SERIALIZER.query("skip", skip, 'int', minimum=0) + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -81,10 +82,11 @@ def build_get_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: - api_version = "2021-08-01" + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + accept = "application/json" # Construct URL - url = kwargs.pop("template_url", '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}') + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}") # pylint: disable=line-too-long path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str'), "serviceName": _SERIALIZER.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])?$'), @@ -93,21 +95,21 @@ def build_get_request( "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str'), } - url = _format_url_section(url, **path_format_arguments) + _url = _format_url_section(_url, **path_format_arguments) # Construct parameters - query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] - query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') # Construct headers - header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] - header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') return HttpRequest( method="GET", - url=url, - params=query_parameters, - headers=header_parameters, + url=_url, + params=_query_parameters, + headers=_header_parameters, **kwargs ) @@ -118,7 +120,7 @@ class UserSubscriptionOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~api_management_client.models + :type models: ~azure.mgmt.apimanagement.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -161,18 +163,20 @@ def list( 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 |
. + contains, startswith, endswith |
. Default value is None. :type filter: str - :param top: Number of records to return. + :param top: Number of records to return. Default value is None. :type top: int - :param skip: Number of records to skip. + :param skip: Number of records to skip. Default value is None. :type skip: int :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either SubscriptionCollection or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~api_management_client.models.SubscriptionCollection] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.apimanagement.models.SubscriptionCollection] :raises: ~azure.core.exceptions.HttpResponseError """ + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionCollection"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -186,6 +190,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -201,6 +206,7 @@ def prepare_request(next_link=None): service_name=service_name, user_id=user_id, subscription_id=self._config.subscription_id, + api_version=api_version, filter=filter, top=top, skip=skip, @@ -221,7 +227,11 @@ def extract_data(pipeline_response): def get_next(next_link=None): request = prepare_request(next_link) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -235,7 +245,7 @@ def get_next(next_link=None): return ItemPaged( get_next, extract_data ) - list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions'} # type: ignore + list.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions"} # type: ignore @distributed_trace def get( @@ -259,7 +269,7 @@ def get( :type sid: str :keyword callable cls: A custom type or function that will be passed the direct response :return: SubscriptionContract, or the result of cls(response) - :rtype: ~api_management_client.models.SubscriptionContract + :rtype: ~azure.mgmt.apimanagement.models.SubscriptionContract :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.SubscriptionContract"] @@ -268,6 +278,8 @@ def get( } error_map.update(kwargs.pop('error_map', {})) + api_version = kwargs.pop('api_version', "2021-08-01") # type: str + request = build_get_request( resource_group_name=resource_group_name, @@ -275,12 +287,17 @@ def get( user_id=user_id, sid=sid, subscription_id=self._config.subscription_id, + api_version=api_version, template_url=self.get.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) response = pipeline_response.http_response if response.status_code not in [200]: @@ -298,5 +315,5 @@ def get( return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}'} # type: ignore + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions/{sid}"} # type: ignore