Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sdk/mobilenetwork/azure-mgmt-mobilenetwork/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"commit": "62815acf41c163d6e0309dd791bd3476016ffd34",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@5.16.0",
"@autorest/modelerfour@4.19.3"
"@autorest/python@6.2.7",
"@autorest/modelerfour@4.24.3"
],
"commit": "90b7b5da32d8e9e2d22d0814aed7207c823ba79a",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/mobilenetwork/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.16.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"autorest_command": "autorest specification/mobilenetwork/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.2.7 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"readme": "specification/mobilenetwork/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@

try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
from ._patch import * # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['MobileNetworkManagementClient']

__all__ = [
"MobileNetworkManagementClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

import sys
from typing import Any, TYPE_CHECKING

from azure.core.configuration import Configuration
Expand All @@ -14,6 +15,11 @@

from ._version import VERSION

if sys.version_info >= (3, 8):
from typing import Literal # pylint: disable=no-name-in-module, ungrouped-imports
else:
from typing_extensions import Literal # type: ignore # pylint: disable=ungrouped-imports

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential
Expand All @@ -25,23 +31,18 @@ class MobileNetworkManagementClientConfiguration(Configuration): # pylint: disa
Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(MobileNetworkManagementClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-04-01-preview") # type: str
api_version: Literal["2022-11-01"] = kwargs.pop("api_version", "2022-11-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -51,23 +52,21 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-mobilenetwork/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-mobilenetwork/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
def _configure(self, **kwargs: Any) -> None:
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,38 @@
from copy import deepcopy
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 . import models
from . import models as _models
from ._configuration import MobileNetworkManagementClientConfiguration
from .operations import AttachedDataNetworksOperations, DataNetworksOperations, MobileNetworksOperations, Operations, PacketCoreControlPlaneVersionsOperations, PacketCoreControlPlanesOperations, PacketCoreDataPlanesOperations, ServicesOperations, SimGroupsOperations, SimPoliciesOperations, SimsOperations, SitesOperations, SlicesOperations
from ._serialization import Deserializer, Serializer
from .operations import (
AttachedDataNetworksOperations,
DataNetworksOperations,
MobileNetworksOperations,
Operations,
PacketCoreControlPlaneOperations,
PacketCoreControlPlaneVersionsOperations,
PacketCoreControlPlanesOperations,
PacketCoreDataPlanesOperations,
ServicesOperations,
SimGroupsOperations,
SimOperations,
SimPoliciesOperations,
SimsOperations,
SitesOperations,
SlicesOperations,
)

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class MobileNetworkManagementClient: # pylint: disable=too-many-instance-attributes
"""The resources in this swagger specification will be used to manage attached data network
resources in mobile network attached to a particular packet core instance.

class MobileNetworkManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""The resources in this API specification will be used to manage attached data network resources
in mobile network attached to a particular packet core instance.

:ivar attached_data_networks: AttachedDataNetworksOperations operations
:vartype attached_data_networks:
Expand All @@ -33,17 +49,14 @@ class MobileNetworkManagementClient: # pylint: disable=too-many-instance-attr
:vartype data_networks: azure.mgmt.mobilenetwork.operations.DataNetworksOperations
:ivar mobile_networks: MobileNetworksOperations operations
:vartype mobile_networks: azure.mgmt.mobilenetwork.operations.MobileNetworksOperations
:ivar sites: SitesOperations operations
:vartype sites: azure.mgmt.mobilenetwork.operations.SitesOperations
:ivar sim_groups: SimGroupsOperations operations
:vartype sim_groups: azure.mgmt.mobilenetwork.operations.SimGroupsOperations
:ivar sims: SimsOperations operations
:vartype sims: azure.mgmt.mobilenetwork.operations.SimsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.mobilenetwork.operations.Operations
:ivar packet_core_control_planes: PacketCoreControlPlanesOperations operations
:vartype packet_core_control_planes:
azure.mgmt.mobilenetwork.operations.PacketCoreControlPlanesOperations
:ivar packet_core_control_plane: PacketCoreControlPlaneOperations operations
:vartype packet_core_control_plane:
azure.mgmt.mobilenetwork.operations.PacketCoreControlPlaneOperations
:ivar packet_core_control_plane_versions: PacketCoreControlPlaneVersionsOperations operations
:vartype packet_core_control_plane_versions:
azure.mgmt.mobilenetwork.operations.PacketCoreControlPlaneVersionsOperations
Expand All @@ -52,18 +65,26 @@ class MobileNetworkManagementClient: # pylint: disable=too-many-instance-attr
azure.mgmt.mobilenetwork.operations.PacketCoreDataPlanesOperations
:ivar services: ServicesOperations operations
:vartype services: azure.mgmt.mobilenetwork.operations.ServicesOperations
:ivar sims: SimsOperations operations
:vartype sims: azure.mgmt.mobilenetwork.operations.SimsOperations
:ivar sim: SimOperations operations
:vartype sim: azure.mgmt.mobilenetwork.operations.SimOperations
:ivar sim_groups: SimGroupsOperations operations
:vartype sim_groups: azure.mgmt.mobilenetwork.operations.SimGroupsOperations
:ivar sim_policies: SimPoliciesOperations operations
:vartype sim_policies: azure.mgmt.mobilenetwork.operations.SimPoliciesOperations
:ivar sites: SitesOperations operations
:vartype sites: azure.mgmt.mobilenetwork.operations.SitesOperations
:ivar slices: SlicesOperations operations
:vartype slices: azure.mgmt.mobilenetwork.operations.SlicesOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2022-04-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2022-11-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.
Expand All @@ -76,35 +97,25 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = MobileNetworkManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._config = MobileNetworkManagementClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.attached_data_networks = AttachedDataNetworksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.data_networks = DataNetworksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.mobile_networks = MobileNetworksOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.sites = SitesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.sim_groups = SimGroupsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.sims = SimsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(
self.data_networks = DataNetworksOperations(self._client, self._config, self._serialize, self._deserialize)
self.mobile_networks = MobileNetworksOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.packet_core_control_planes = PacketCoreControlPlanesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.packet_core_control_planes = PacketCoreControlPlanesOperations(
self.packet_core_control_plane = PacketCoreControlPlaneOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.packet_core_control_plane_versions = PacketCoreControlPlaneVersionsOperations(
Expand All @@ -113,22 +124,15 @@ def __init__(
self.packet_core_data_planes = PacketCoreDataPlanesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.services = ServicesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.sim_policies = SimPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.slices = SlicesOperations(
self._client, self._config, self._serialize, self._deserialize
)


def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize)
self.sims = SimsOperations(self._client, self._config, self._serialize, self._deserialize)
self.sim = SimOperations(self._client, self._config, self._serialize, self._deserialize)
self.sim_groups = SimGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
self.sim_policies = SimPoliciesOperations(self._client, self._config, self._serialize, self._deserialize)
self.sites = SitesOperations(self._client, self._config, self._serialize, self._deserialize)
self.slices = SlicesOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.

>>> from azure.core.rest import HttpRequest
Expand All @@ -137,7 +141,7 @@ def _send_request(
>>> response = client._send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
Expand All @@ -150,15 +154,12 @@ def _send_request(
request_copy.url = self._client.format_url(request_copy.url)
return self._client.send_request(request_copy, **kwargs)

def close(self):
# type: () -> None
def close(self) -> None:
self._client.close()

def __enter__(self):
# type: () -> MobileNetworkManagementClient
def __enter__(self) -> "MobileNetworkManagementClient":
self._client.__enter__()
return self

def __exit__(self, *exc_details):
# type: (Any) -> None
def __exit__(self, *exc_details) -> None:
self._client.__exit__(*exc_details)
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass
Loading