Skip to content
Open
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
Empty file added batch_models_patch.txt
Empty file.
17 changes: 17 additions & 0 deletions sdk/resources/azure-mgmt-resource/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Release History

## 25.1.0b1 (TBD)

### Features Added

- Added support for ARM Batch Operations API (2025-08-01-preview)
- New `BatchOperations` operation group with the following methods:
- `begin_invoke_at_subscription_scope()` - Execute batch requests at subscription scope
- `begin_invoke_at_resource_group_scope()` - Execute batch requests at resource group scope
- New models for batch operations:
- `BatchRequest` - Individual request specification within a batch
- `BatchRequests` - Container for multiple batch requests
- `BatchResponse` - Individual response from a batch request
- `BatchResponseStatus` - Overall batch operation status and results
- `BatchProvisioningState` - Enum for batch operation states
- Batch operations support Long Running Operations (LRO) with proper polling
- Both synchronous and asynchronous execution patterns supported
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CHANGELOG states "Both synchronous and asynchronous execution patterns supported" but there is no async implementation of BatchOperations in the aio/operations directory. All other operations (ProvidersOperations, ResourcesOperations, ResourceGroupsOperations, TagsOperations) have async versions in azure/mgmt/resource/resources/aio/operations/, but BatchOperations is missing. Either add the async implementation or update the CHANGELOG to remove the claim about async support.

Copilot uses AI. Check for mistakes.

## 25.0.0 (2026-02-04)

### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
ResourceGroupsOperations,
ResourcesOperations,
TagsOperations,
BatchOperations,
)

if TYPE_CHECKING:
Expand All @@ -50,6 +51,8 @@ class ResourceManagementClient:
:vartype resource_groups: azure.mgmt.resource.resources.operations.ResourceGroupsOperations
:ivar tags: TagsOperations operations
:vartype tags: azure.mgmt.resource.resources.operations.TagsOperations
:ivar batch_operations: BatchOperations operations (2025-08-01-preview)
:vartype batch_operations: azure.mgmt.resource.resources.operations.BatchOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The Microsoft Azure subscription ID. Required.
Expand Down Expand Up @@ -120,6 +123,7 @@ def __init__(
self.resources = ResourcesOperations(self._client, self._config, self._serialize, self._deserialize)
self.resource_groups = ResourceGroupsOperations(self._client, self._config, self._serialize, self._deserialize)
self.tags = TagsOperations(self._client, self._config, self._serialize, self._deserialize)
self.batch_operations = BatchOperations(self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
AliasPathMetadata,
AliasPattern,
ApiProfile,
BatchRequest,
BatchRequests,
BatchResponse,
BatchResponseItem,
BatchResponseStatus,
ErrorAdditionalInfo,
ErrorResponse,
ExportTemplateRequest,
Expand Down Expand Up @@ -76,6 +81,7 @@
ResourceIdentityType,
TagsPatchOperation,
)

from ._patch import __all__ as _patch_all
from ._patch import *
from ._patch import patch_sdk as _patch_sdk
Expand All @@ -86,6 +92,11 @@
"AliasPathMetadata",
"AliasPattern",
"ApiProfile",
"BatchRequest",
"BatchRequests",
"BatchResponse",
"BatchResponseItem",
"BatchResponseStatus",
"ErrorAdditionalInfo",
"ErrorResponse",
"ExportTemplateRequest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import datetime
from typing import Any, Optional, TYPE_CHECKING, Union

from azure.core import CaseInsensitiveEnumMeta
from .._utils import serialization as _serialization

if TYPE_CHECKING:
Expand Down Expand Up @@ -2101,3 +2102,178 @@ def __init__(self, *, location: Optional[str] = None, zones: Optional[list[str]]
super().__init__(**kwargs)
self.location = location
self.zones = zones


# Batch operation models for Azure Resource Manager (API version 2025-04-01)


class BatchRequest(_serialization.Model):
"""Batch request definition.

:ivar http_method: The HTTP method for the request. Required.
:vartype http_method: str
:ivar relative_url: The relative URL for the request. Required.
:vartype relative_url: str
:ivar name: Optional name to identify this request within the batch. Optional.
:vartype name: str
:ivar body: The request body (for PUT/PATCH/POST operations). Optional.
:vartype body: any
:ivar headers: Request headers. Optional.
:vartype headers: dict[str, str]
:ivar depends_on: List of request names that this request depends on. Optional.
:vartype depends_on: list[str]
"""

_attribute_map = {
"http_method": {"key": "httpMethod", "type": "str"},
"relative_url": {"key": "relativeUrl", "type": "str"},
"name": {"key": "name", "type": "str"},
"body": {"key": "body", "type": "object"},
"headers": {"key": "headers", "type": "{str}"},
"depends_on": {"key": "dependsOn", "type": "[str]"},
}

def __init__(
self,
*,
http_method: str,
relative_url: str,
name: Optional[str] = None,
body: Optional[Any] = None,
headers: Optional[dict[str, str]] = None,
depends_on: Optional[list[str]] = None,
**kwargs: Any
) -> None:
"""
:keyword http_method: The HTTP method for the request. Required.
:paramtype http_method: str
:keyword relative_url: The relative URL for the request. Required.
:paramtype relative_url: str
:keyword name: Optional name to identify this request within the batch. Optional.
:paramtype name: str
:keyword body: The request body (for PUT/PATCH/POST operations). Optional.
:paramtype body: any
:keyword headers: Request headers. Optional.
:paramtype headers: dict[str, str]
:keyword depends_on: List of request names that this request depends on. Optional.
:paramtype depends_on: list[str]
"""
super().__init__(**kwargs)
self.http_method = http_method
self.relative_url = relative_url
self.name = name
self.body = body
self.headers = headers
self.depends_on = depends_on


class BatchRequests(_serialization.Model):
"""Collection of batch requests.

:ivar requests: The batch requests to execute. Required.
:vartype requests: list[~azure.mgmt.resource.resources.models.BatchRequest]
"""

_attribute_map = {
"requests": {"key": "requests", "type": "[BatchRequest]"},
}

def __init__(self, *, requests: list["BatchRequest"], **kwargs: Any) -> None:
"""
:keyword requests: The batch requests to execute. Required.
:paramtype requests: list[~azure.mgmt.resource.resources.models.BatchRequest]
"""
super().__init__(**kwargs)
self.requests = requests


class BatchResponseItem(_serialization.Model):
"""Individual response within a batch response.

:ivar name: The name of the request (if provided in the batch request). Optional.
:vartype name: str
:ivar status_code: The HTTP status code of the response. Required.
:vartype status_code: int
:ivar status: The status of the batch response item. Required.
:vartype status: str or ~azure.mgmt.resource.resources.models.BatchResponseStatus
:ivar body: The response body. Optional.
:vartype body: any
:ivar headers: Response headers. Optional.
:vartype headers: dict[str, str]
"""

_attribute_map = {
"name": {"key": "name", "type": "str"},
"status_code": {"key": "statusCode", "type": "int"},
"status": {"key": "status", "type": "str"},
"body": {"key": "body", "type": "object"},
"headers": {"key": "headers", "type": "{str}"},
}

def __init__(
self,
*,
status_code: int,
status: Union[str, "BatchResponseStatus"],
name: Optional[str] = None,
body: Optional[Any] = None,
headers: Optional[dict[str, str]] = None,
**kwargs: Any
) -> None:
"""
:keyword status_code: The HTTP status code of the response. Required.
:paramtype status_code: int
:keyword status: The status of the batch response item. Required.
:paramtype status: str or ~azure.mgmt.resource.resources.models.BatchResponseStatus
:keyword name: The name of the request (if provided in the batch request). Optional.
:paramtype name: str
:keyword body: The response body. Optional.
:paramtype body: any
:keyword headers: Response headers. Optional.
:paramtype headers: dict[str, str]
"""
super().__init__(**kwargs)
self.name = name
self.status_code = status_code
self.status = status
self.body = body
self.headers = headers


class BatchResponse(_serialization.Model):
"""Batch operation response.

:ivar responses: Individual responses within the batch. Required.
:vartype responses: list[~azure.mgmt.resource.resources.models.BatchResponseItem]
"""

_attribute_map = {
"responses": {"key": "responses", "type": "[BatchResponseItem]"},
}

def __init__(self, *, responses: list["BatchResponseItem"], **kwargs: Any) -> None:
"""
:keyword responses: Individual responses within the batch. Required.
:paramtype responses: list[~azure.mgmt.resource.resources.models.BatchResponseItem]
"""
super().__init__(**kwargs)
self.responses = responses


class BatchResponseStatus(str, metaclass=CaseInsensitiveEnumMeta):
"""Batch response status enumeration.

:cvar SUCCEEDED: The request succeeded.
:vartype SUCCEEDED: str
:cvar FAILED: The request failed.
:vartype FAILED: str
:cvar VALIDATION_FAILED: The request was processed but failed validation.
:vartype VALIDATION_FAILED: str
:cvar SKIPPED: The request was skipped due to dependency failure.
:vartype SKIPPED: str
"""

SUCCEEDED = "Succeeded"
FAILED = "Failed"
VALIDATION_FAILED = "ValidationFailed"
SKIPPED = "Skipped"
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from ._operations import ResourcesOperations # type: ignore
from ._operations import ResourceGroupsOperations # type: ignore
from ._operations import TagsOperations # type: ignore
from ._batch_operations import BatchOperations # type: ignore

from ._patch import __all__ as _patch_all
from ._patch import *
Expand All @@ -30,6 +31,7 @@
"ResourcesOperations",
"ResourceGroupsOperations",
"TagsOperations",
"BatchOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
_patch_sdk()
Loading
Loading