Skip to content

Commit 07f5c74

Browse files
author
SDKAuto
committed
CodeGen from PR 34329 in Azure/azure-rest-api-specs
Merge f4e16d577be09de3313e5c8e60489ec62274d75d into 4a748a953cb8408283e3b5e9fd8773e012ca74ae
1 parent fa88072 commit 07f5c74

File tree

67 files changed

+4193
-3997
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+4193
-3997
lines changed

sdk/orbital/azure-mgmt-orbital/CHANGELOG.md

+62
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# Release History
22

3+
## 3.0.0 (2025-05-06)
4+
5+
### Features Added
6+
7+
- Added model `AzureResourceManagerArmResponseAvailableContactsListResult`
8+
- Method `ContactProfilesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, contact_profile_name: str, parameters: ContactProfile, content_type: str)`
9+
- Method `ContactProfilesOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, contact_profile_name: str, parameters: IO[bytes], content_type: str)`
10+
- Method `ContactProfilesOperations.begin_update_tags` has a new overload `def begin_update_tags(self: None, resource_group_name: str, contact_profile_name: str, parameters: IO[bytes], content_type: str)`
11+
- Method `ContactsOperations.begin_create` has a new overload `def begin_create(self: None, resource_group_name: str, spacecraft_name: str, contact_name: str, parameters: IO[bytes], content_type: str)`
12+
- Method `SpacecraftsOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, spacecraft_name: str, parameters: Spacecraft, content_type: str)`
13+
- Method `SpacecraftsOperations.begin_create_or_update` has a new overload `def begin_create_or_update(self: None, resource_group_name: str, spacecraft_name: str, parameters: IO[bytes], content_type: str)`
14+
- Method `SpacecraftsOperations.begin_list_available_contacts` has a new overload `def begin_list_available_contacts(self: None, resource_group_name: str, spacecraft_name: str, parameters: ContactParameters, content_type: str)`
15+
- Method `SpacecraftsOperations.begin_list_available_contacts` has a new overload `def begin_list_available_contacts(self: None, resource_group_name: str, spacecraft_name: str, parameters: IO[bytes], content_type: str)`
16+
- Method `SpacecraftsOperations.begin_update_tags` has a new overload `def begin_update_tags(self: None, resource_group_name: str, spacecraft_name: str, parameters: IO[bytes], content_type: str)`
17+
18+
### Breaking Changes
19+
20+
- Method `AvailableContactsListResult.__init__` removed default value `None` from its parameter `value`
21+
- Method `AvailableGroundStationListResult.__init__` removed default value `None` from its parameter `value`
22+
- Method `ContactListResult.__init__` removed default value `None` from its parameter `value`
23+
- Method `ContactProfileListResult.__init__` removed default value `None` from its parameter `value`
24+
- Method `SpacecraftListResult.__init__` removed default value `None` from its parameter `value`
25+
- Deleted or renamed model `AvailableContactsProperties`
26+
- Deleted or renamed model `AvailableContactsSpacecraft`
27+
- Deleted or renamed model `AvailableGroundStationProperties`
28+
- Deleted or renamed model `AvailableGroundStationPropertiesAutoGenerated`
29+
- Deleted or renamed model `Capability`
30+
- Deleted or renamed model `ContactInstanceProperties`
31+
- Deleted or renamed model `ContactParametersContactProfile`
32+
- Deleted or renamed model `ContactProfileProperties`
33+
- Deleted or renamed model `ContactProfilesProperties`
34+
- Deleted or renamed model `ContactProfilesPropertiesProvisioningState`
35+
- Deleted or renamed model `ContactsPropertiesContactProfile`
36+
- Deleted or renamed model `ContactsPropertiesProvisioningState`
37+
- Deleted or renamed model `ResourceIdListResultValueItem`
38+
- Method `ContactProfilesOperations.begin_create_or_update` inserted a `positional_or_keyword` parameter `parameters`
39+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `location` of kind `positional_or_keyword`
40+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `network_configuration` of kind `positional_or_keyword`
41+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `links` of kind `positional_or_keyword`
42+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `tags` of kind `positional_or_keyword`
43+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `provisioning_state` of kind `positional_or_keyword`
44+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `minimum_viable_contact_duration` of kind `positional_or_keyword`
45+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `minimum_elevation_degrees` of kind `positional_or_keyword`
46+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `auto_tracking_configuration` of kind `positional_or_keyword`
47+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `event_hub_uri` of kind `positional_or_keyword`
48+
- Method `ContactProfilesOperations.begin_create_or_update` deleted or renamed its parameter `third_party_configurations` of kind `positional_or_keyword`
49+
- Deleted or renamed method `OperationsResultsOperations.begin_get`
50+
- Method `SpacecraftsOperations.begin_create_or_update` inserted a `positional_or_keyword` parameter `parameters`
51+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `location` of kind `positional_or_keyword`
52+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `title_line` of kind `positional_or_keyword`
53+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `tle_line1` of kind `positional_or_keyword`
54+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `tle_line2` of kind `positional_or_keyword`
55+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `links` of kind `positional_or_keyword`
56+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `tags` of kind `positional_or_keyword`
57+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `provisioning_state` of kind `positional_or_keyword`
58+
- Method `SpacecraftsOperations.begin_create_or_update` deleted or renamed its parameter `norad_id` of kind `positional_or_keyword`
59+
- Method `SpacecraftsOperations.begin_list_available_contacts` inserted a `positional_or_keyword` parameter `parameters`
60+
- Method `SpacecraftsOperations.begin_list_available_contacts` deleted or renamed its parameter `contact_profile` of kind `positional_or_keyword`
61+
- Method `SpacecraftsOperations.begin_list_available_contacts` deleted or renamed its parameter `ground_station_name` of kind `positional_or_keyword`
62+
- Method `SpacecraftsOperations.begin_list_available_contacts` deleted or renamed its parameter `start_time` of kind `positional_or_keyword`
63+
- Method `SpacecraftsOperations.begin_list_available_contacts` deleted or renamed its parameter `end_time` of kind `positional_or_keyword`
64+
365
## 2.0.0 (2023-03-20)
466

567
### Features Added

sdk/orbital/azure-mgmt-orbital/README.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Orbital Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.9+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.9+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package
@@ -24,7 +24,7 @@ pip install azure-identity
2424

2525
### Authentication
2626

27-
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configure of following environment variables.
27+
By default, [Azure Active Directory](https://aka.ms/awps/aad) token authentication depends on correct configuration of the following environment variables.
2828

2929
- `AZURE_CLIENT_ID` for Azure client ID.
3030
- `AZURE_TENANT_ID` for Azure tenant ID.
@@ -45,8 +45,9 @@ client = AzureOrbital(credential=DefaultAzureCredential(), subscription_id=sub_i
4545

4646
## Examples
4747

48-
49-
Code samples for this package can be found at [Orbital Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com and [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
48+
Code samples for this package can be found at:
49+
- [Search Orbital Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com
50+
- [Azure Python Mgmt SDK Samples Repo](https://aka.ms/azsdk/python/mgmt/samples)
5051

5152

5253
## Troubleshooting
@@ -58,6 +59,3 @@ Code samples for this package can be found at [Orbital Management](https://docs.
5859
If you encounter any bugs or have suggestions, please file an issue in the
5960
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
6061
section of the project.
61-
62-
63-
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"commit": "66174681c09b101de03fd35399080cfbccc93e8f",
2+
"commit": "14ddb11bf9f301e56ffae91fddb70d797b8918ca",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4-
"autorest": "3.9.2",
4+
"autorest": "3.10.2",
55
"use": [
6-
"@autorest/python@6.4.0",
7-
"@autorest/modelerfour@4.24.3"
6+
"@autorest/python@6.34.1",
7+
"@autorest/modelerfour@4.27.0"
88
],
9-
"autorest_command": "autorest specification/orbital/resource-manager/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.0 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
9+
"autorest_command": "autorest specification/orbital/resource-manager/readme.md --generate-sample=True --generate-test=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.34.1 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False",
1010
"readme": "specification/orbital/resource-manager/readme.md"
1111
}

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/__init__.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,28 @@
55
# Code generated by Microsoft (R) AutoRest Code Generator.
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
89

9-
from ._azure_orbital import AzureOrbital
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._azure_orbital import AzureOrbital # type: ignore
1016
from ._version import VERSION
1117

1218
__version__ = VERSION
1319

1420
try:
1521
from ._patch import __all__ as _patch_all
16-
from ._patch import * # pylint: disable=unused-wildcard-import
22+
from ._patch import *
1723
except ImportError:
1824
_patch_all = []
1925
from ._patch import patch_sdk as _patch_sdk
2026

2127
__all__ = [
2228
"AzureOrbital",
2329
]
24-
__all__.extend([p for p in _patch_all if p not in __all__])
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
2531

2632
_patch_sdk()

sdk/orbital/azure-mgmt-orbital/azure/mgmt/orbital/_azure_orbital.py

+51-25
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,19 @@
77
# --------------------------------------------------------------------------
88

99
from copy import deepcopy
10-
from typing import Any, TYPE_CHECKING
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
1112

13+
from azure.core.pipeline import policies
1214
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
1316
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
1419

1520
from . import models as _models
1621
from ._configuration import AzureOrbitalConfiguration
17-
from ._serialization import Deserializer, Serializer
22+
from ._utils.serialization import Deserializer, Serializer
1823
from .operations import (
1924
AvailableGroundStationsOperations,
2025
ContactProfilesOperations,
@@ -25,31 +30,30 @@
2530
)
2631

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

3135

32-
class AzureOrbital: # pylint: disable=client-accepts-api-version-keyword
36+
class AzureOrbital:
3337
"""Azure Orbital service.
3438
3539
:ivar operations: Operations operations
3640
:vartype operations: azure.mgmt.orbital.operations.Operations
37-
:ivar spacecrafts: SpacecraftsOperations operations
38-
:vartype spacecrafts: azure.mgmt.orbital.operations.SpacecraftsOperations
39-
:ivar contacts: ContactsOperations operations
40-
:vartype contacts: azure.mgmt.orbital.operations.ContactsOperations
41-
:ivar contact_profiles: ContactProfilesOperations operations
42-
:vartype contact_profiles: azure.mgmt.orbital.operations.ContactProfilesOperations
4341
:ivar available_ground_stations: AvailableGroundStationsOperations operations
4442
:vartype available_ground_stations:
4543
azure.mgmt.orbital.operations.AvailableGroundStationsOperations
44+
:ivar contact_profiles: ContactProfilesOperations operations
45+
:vartype contact_profiles: azure.mgmt.orbital.operations.ContactProfilesOperations
4646
:ivar operations_results: OperationsResultsOperations operations
4747
:vartype operations_results: azure.mgmt.orbital.operations.OperationsResultsOperations
48+
:ivar spacecrafts: SpacecraftsOperations operations
49+
:vartype spacecrafts: azure.mgmt.orbital.operations.SpacecraftsOperations
50+
:ivar contacts: ContactsOperations operations
51+
:vartype contacts: azure.mgmt.orbital.operations.ContactsOperations
4852
:param credential: Credential needed for the client to connect to Azure. Required.
4953
:type credential: ~azure.core.credentials.TokenCredential
5054
:param subscription_id: The ID of the target subscription. Required.
5155
:type subscription_id: str
52-
:param base_url: Service URL. Default value is "https://management.azure.com".
56+
:param base_url: Service URL. Default value is None.
5357
:type base_url: str
5458
:keyword api_version: Api Version. Default value is "2022-11-01". Note that overriding this
5559
default value may result in unsupported behavior.
@@ -59,33 +63,55 @@ class AzureOrbital: # pylint: disable=client-accepts-api-version-keyword
5963
"""
6064

6165
def __init__(
62-
self,
63-
credential: "TokenCredential",
64-
subscription_id: str,
65-
base_url: str = "https://management.azure.com",
66-
**kwargs: Any
66+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
6767
) -> None:
68-
self._config = AzureOrbitalConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
69-
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
68+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
69+
_endpoints = get_arm_endpoints(_cloud)
70+
if not base_url:
71+
base_url = _endpoints["resource_manager"]
72+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
73+
self._config = AzureOrbitalConfiguration(
74+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
75+
)
76+
77+
_policies = kwargs.pop("policies", None)
78+
if _policies is None:
79+
_policies = [
80+
policies.RequestIdPolicy(**kwargs),
81+
self._config.headers_policy,
82+
self._config.user_agent_policy,
83+
self._config.proxy_policy,
84+
policies.ContentDecodePolicy(**kwargs),
85+
ARMAutoResourceProviderRegistrationPolicy(),
86+
self._config.redirect_policy,
87+
self._config.retry_policy,
88+
self._config.authentication_policy,
89+
self._config.custom_hook_policy,
90+
self._config.logging_policy,
91+
policies.DistributedTracingPolicy(**kwargs),
92+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
93+
self._config.http_logging_policy,
94+
]
95+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
7096

7197
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
7298
self._serialize = Serializer(client_models)
7399
self._deserialize = Deserializer(client_models)
74100
self._serialize.client_side_validation = False
75101
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
76-
self.spacecrafts = SpacecraftsOperations(self._client, self._config, self._serialize, self._deserialize)
77-
self.contacts = ContactsOperations(self._client, self._config, self._serialize, self._deserialize)
78-
self.contact_profiles = ContactProfilesOperations(
102+
self.available_ground_stations = AvailableGroundStationsOperations(
79103
self._client, self._config, self._serialize, self._deserialize
80104
)
81-
self.available_ground_stations = AvailableGroundStationsOperations(
105+
self.contact_profiles = ContactProfilesOperations(
82106
self._client, self._config, self._serialize, self._deserialize
83107
)
84108
self.operations_results = OperationsResultsOperations(
85109
self._client, self._config, self._serialize, self._deserialize
86110
)
111+
self.spacecrafts = SpacecraftsOperations(self._client, self._config, self._serialize, self._deserialize)
112+
self.contacts = ContactsOperations(self._client, self._config, self._serialize, self._deserialize)
87113

88-
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
114+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
89115
"""Runs the network request through the client's chained policies.
90116
91117
>>> from azure.core.rest import HttpRequest
@@ -105,12 +131,12 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
105131

106132
request_copy = deepcopy(request)
107133
request_copy.url = self._client.format_url(request_copy.url)
108-
return self._client.send_request(request_copy, **kwargs)
134+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
109135

110136
def close(self) -> None:
111137
self._client.close()
112138

113-
def __enter__(self) -> "AzureOrbital":
139+
def __enter__(self) -> Self:
114140
self._client.__enter__()
115141
return self
116142

0 commit comments

Comments
 (0)