Skip to content

Commit

Permalink
[AutoRelease] t2-devopsinfrastructure-2024-10-17-69763(can only be me…
Browse files Browse the repository at this point in the history
…rged by SDK owner) (#37959)

* code and test

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* update-testcase

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: azure-sdk <PythonSdkPipelines>
Co-authored-by: ChenxiJiang333 <[email protected]>
Co-authored-by: ChenxiJiang333 <[email protected]>
  • Loading branch information
3 people authored Nov 21, 2024
1 parent 5771ed1 commit e744c71
Show file tree
Hide file tree
Showing 51 changed files with 2,456 additions and 6,333 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Release History

## 1.0.0 (2024-11-21)

### Features Added

- Model `Quota` added property `unit`
- Model `Quota` added property `current_value`
- Model `Quota` added property `limit`
- Operation group `SubscriptionUsagesOperations` added method `usages`

### Breaking Changes

- Enum `ManagedServiceIdentityType` renamed its value `SYSTEM_AND_USER_ASSIGNED` to `SYSTEM_ASSIGNED_USER_ASSIGNED`
- Enum `OsDiskStorageAccountType` renamed its value `STANDARD_S_S_D` to `STANDARD_SSD`
- Model `Quota` deleted or renamed its instance variable `properties`
- Model `Quota` deleted or renamed its instance variable `type`
- Model `Quota` deleted or renamed its instance variable `system_data`
- Deleted or renamed enum value `StorageAccountType.PREMIUM_L_R_S`
- Deleted or renamed enum value `StorageAccountType.PREMIUM_Z_R_S`
- Deleted or renamed enum value `StorageAccountType.STANDARD_L_R_S`
- Deleted or renamed enum value `StorageAccountType.STANDARD_S_S_D_L_R_S`
- Deleted or renamed enum value `StorageAccountType.STANDARD_S_S_D_Z_R_S`
- Deleted or renamed model `ActionType`
- Deleted or renamed model `Operation`
- Deleted or renamed model `OperationDisplay`
- Deleted or renamed model `Origin`
- Deleted or renamed model `QuotaProperties`
- Deleted or renamed method `SubscriptionUsagesOperations.list_by_location`

## 1.0.0b1 (2024-05-29)

- Initial version
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"commit": "53bed2dccf392c14a412735c38a0f55645812294",
"commit": "95e89f00932d2a8f04ff80e28f8ce10ee586ca7d",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure",
"@azure-tools/typespec-python": "0.23.12",
"@autorest/python": "6.13.17"
"typespec_src": "specification/devopsinfrastructure/Microsoft.DevOpsInfrastructure.Management",
"@azure-tools/typespec-python": "0.36.0"
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
__all__ = [
"DevOpsInfrastructureMgmtClient",
]
__all__.extend([p for p in _patch_all if p not in __all__])
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing_extensions import Self

from azure.core.pipeline import policies
from azure.core.rest import HttpRequest, HttpResponse
Expand All @@ -26,11 +27,10 @@
)

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


class DevOpsInfrastructureMgmtClient: # pylint: disable=client-accepts-api-version-keyword
class DevOpsInfrastructureMgmtClient:
"""DevOpsInfrastructureMgmtClient.
:ivar operations: Operations operations
Expand All @@ -48,13 +48,12 @@ class DevOpsInfrastructureMgmtClient: # pylint: disable=client-accepts-api-vers
:vartype image_versions: azure.mgmt.devopsinfrastructure.operations.ImageVersionsOperations
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-04-04-preview". Note that overriding this default value may result in unsupported
behavior.
:keyword api_version: The API version to use for this operation. Default value is "2024-10-19".
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 @@ -67,8 +66,9 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
_endpoint = "{endpoint}"
self._config = DevOpsInfrastructureMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
credential=credential, subscription_id=subscription_id, base_url=base_url, **kwargs
)
_policies = kwargs.pop("policies", None)
if _policies is None:
Expand All @@ -88,7 +88,7 @@ def __init__(
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
self._config.http_logging_policy,
]
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, policies=_policies, **kwargs)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=_endpoint, policies=_policies, **kwargs)

self._serialize = Serializer()
self._deserialize = Deserializer()
Expand Down Expand Up @@ -123,13 +123,17 @@ def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs:
"""

request_copy = deepcopy(request)
request_copy.url = self._client.format_url(request_copy.url)
path_format_arguments = {
"endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True),
}

request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments)
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore

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

def __enter__(self) -> "DevOpsInfrastructureMgmtClient":
def __enter__(self) -> Self:
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from ._version import VERSION

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


Expand All @@ -26,16 +25,23 @@ class DevOpsInfrastructureMgmtClientConfiguration: # pylint: disable=too-many-i
:param credential: Credential used to authenticate requests to the service. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: The API version to use for this operation. Default value is
"2024-04-04-preview". Note that overriding this default value may result in unsupported
behavior.
:param base_url: Service host. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: The API version to use for this operation. Default value is "2024-10-19".
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:
api_version: str = kwargs.pop("api_version", "2024-04-04-preview")
def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
api_version: str = kwargs.pop("api_version", "2024-10-19")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -44,6 +50,7 @@ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs

self.credential = credential
self.subscription_id = subscription_id
self.base_url = base_url
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-devopsinfrastructure/{}".format(VERSION))
Expand Down
Loading

0 comments on commit e744c71

Please sign in to comment.