Skip to content

Commit

Permalink
[Fix] Remove unused model for paging operation (#2601)
Browse files Browse the repository at this point in the history
* remove unused model for dpg

* changelog
  • Loading branch information
msyyc authored May 28, 2024
1 parent 915d446 commit 92629d6
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 382 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@azure-tools/typespec-python"
---

Remove unused model for paging operation
2 changes: 1 addition & 1 deletion packages/typespec-python/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function addPagingInformation(
method: SdkPagingServiceMethod<SdkHttpOperation> | SdkLroPagingServiceMethod<SdkHttpOperation>,
operationGroupName: string,
) {
for (const response of Object.values(method.operation.responses)) {
for (const response of method.operation.responses.values()) {
if (response.type && !isAzureCoreModel(response.type)) {
getType(context, response.type)["pageResultModel"] = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"specs.azure.core.basic.models.ListItemInputBody": "_Specs_.Azure.Core.Basic.ListItemInputBody",
"specs.azure.core.basic.models.SecondItem": "_Specs_.Azure.Core.Basic.SecondItem",
"specs.azure.core.basic.models.User": "_Specs_.Azure.Core.Basic.User",
"specs.azure.core.basic.models.UserListResults": "_Specs_.Azure.Core.Basic.CustomPageModel",
"specs.azure.core.basic.models.UserOrder": "_Specs_.Azure.Core.Basic.UserOrder",
"specs.azure.core.basic.models.ListItemInputExtensibleEnum": "_Specs_.Azure.Core.Basic.ListItemInputExtensibleEnum",
"specs.azure.core.basic.BasicClient.two_models_as_page_item.list_first_item": "_Specs_.Azure.Core.Basic.TwoModelsAsPageItem.listFirstItem",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from ._models import ListItemInputBody
from ._models import SecondItem
from ._models import User
from ._models import UserListResults
from ._models import UserOrder

from ._enums import ListItemInputExtensibleEnum
Expand All @@ -23,7 +22,6 @@
"ListItemInputBody",
"SecondItem",
"User",
"UserListResults",
"UserOrder",
"ListItemInputExtensibleEnum",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,41 +122,6 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useles
super().__init__(*args, **kwargs)


class UserListResults(_model_base.Model):
"""UserListResults.
All required parameters must be populated in order to send to server.
:ivar items_property: List of items. Required.
:vartype items_property: list[~specs.azure.core.basic.models.User]
:ivar next_link: Link to fetch more items.
:vartype next_link: str
"""

items_property: List["_models.User"] = rest_field(name="items")
"""List of items. Required."""
next_link: Optional[str] = rest_field(name="nextLink")
"""Link to fetch more items."""

@overload
def __init__(
self,
*,
items_property: List["_models.User"],
next_link: Optional[str] = None,
): ...

@overload
def __init__(self, mapping: Mapping[str, Any]):
"""
:param mapping: raw JSON to initialize the model.
:type mapping: Mapping[str, Any]
"""

def __init__(self, *args: Any, **kwargs: Any) -> None: # pylint: disable=useless-super-delegation
super().__init__(*args, **kwargs)


class UserOrder(_model_base.Model):
"""UserOrder for testing list with expand.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,23 @@
"azure.mgmt.spheredpg.models.Resource": "Azure.ResourceManager.Foundations.Resource",
"azure.mgmt.spheredpg.models.TrackedResource": "Azure.ResourceManager.Foundations.TrackedResource",
"azure.mgmt.spheredpg.models.Catalog": "Microsoft.AzureSphere.Catalog",
"azure.mgmt.spheredpg.models.CatalogListResult": "Azure.ResourceManager.ResourceListResult",
"azure.mgmt.spheredpg.models.CatalogProperties": "Microsoft.AzureSphere.CatalogProperties",
"azure.mgmt.spheredpg.models.CatalogUpdate": "Microsoft.AzureSphere.CatalogUpdate",
"azure.mgmt.spheredpg.models.ProxyResource": "Azure.ResourceManager.Foundations.ProxyResource",
"azure.mgmt.spheredpg.models.Certificate": "Microsoft.AzureSphere.Certificate",
"azure.mgmt.spheredpg.models.CertificateChainResponse": "Microsoft.AzureSphere.CertificateChainResponse",
"azure.mgmt.spheredpg.models.CertificateListResult": "Azure.ResourceManager.ResourceListResult",
"azure.mgmt.spheredpg.models.CertificateProperties": "Microsoft.AzureSphere.CertificateProperties",
"azure.mgmt.spheredpg.models.ClaimDevicesRequest": "Microsoft.AzureSphere.ClaimDevicesRequest",
"azure.mgmt.spheredpg.models.CountElementsResponse": "Microsoft.AzureSphere.CountElementsResponse",
"azure.mgmt.spheredpg.models.CountDevicesResponse": "Microsoft.AzureSphere.CountDevicesResponse",
"azure.mgmt.spheredpg.models.Deployment": "Microsoft.AzureSphere.Deployment",
"azure.mgmt.spheredpg.models.DeploymentListResult": "Azure.ResourceManager.ResourceListResult",
"azure.mgmt.spheredpg.models.DeploymentProperties": "Microsoft.AzureSphere.DeploymentProperties",
"azure.mgmt.spheredpg.models.Device": "Microsoft.AzureSphere.Device",
"azure.mgmt.spheredpg.models.DeviceGroup": "Microsoft.AzureSphere.DeviceGroup",
"azure.mgmt.spheredpg.models.DeviceGroupListResult": "Azure.ResourceManager.ResourceListResult",
"azure.mgmt.spheredpg.models.DeviceGroupProperties": "Microsoft.AzureSphere.DeviceGroupProperties",
"azure.mgmt.spheredpg.models.DeviceGroupUpdate": "Microsoft.AzureSphere.DeviceGroupUpdate",
"azure.mgmt.spheredpg.models.DeviceGroupUpdateProperties": "Microsoft.AzureSphere.DeviceGroupUpdateProperties",
"azure.mgmt.spheredpg.models.DeviceInsight": "Microsoft.AzureSphere.DeviceInsight",
"azure.mgmt.spheredpg.models.DeviceListResult": "Azure.ResourceManager.ResourceListResult",
"azure.mgmt.spheredpg.models.DeviceProperties": "Microsoft.AzureSphere.DeviceProperties",
"azure.mgmt.spheredpg.models.DeviceUpdate": "Microsoft.AzureSphere.DeviceUpdate",
"azure.mgmt.spheredpg.models.DeviceUpdateProperties": "Microsoft.AzureSphere.DeviceUpdateProperties",
Expand All @@ -34,15 +29,11 @@
"azure.mgmt.spheredpg.models.ErrorResponse": "Azure.ResourceManager.ErrorResponse",
"azure.mgmt.spheredpg.models.GenerateCapabilityImageRequest": "Microsoft.AzureSphere.GenerateCapabilityImageRequest",
"azure.mgmt.spheredpg.models.Image": "Microsoft.AzureSphere.Image",
"azure.mgmt.spheredpg.models.ImageListResult": "Azure.ResourceManager.ResourceListResult",
"azure.mgmt.spheredpg.models.ImageProperties": "Microsoft.AzureSphere.ImageProperties",
"azure.mgmt.spheredpg.models.ListDeviceGroupsRequest": "Microsoft.AzureSphere.ListDeviceGroupsRequest",
"azure.mgmt.spheredpg.models.Operation": "Azure.ResourceManager.Foundations.Operation",
"azure.mgmt.spheredpg.models.OperationDisplay": "Azure.ResourceManager.Foundations.OperationDisplay",
"azure.mgmt.spheredpg.models.PagedDeviceInsight": "Microsoft.AzureSphere.PagedDeviceInsight",
"azure.mgmt.spheredpg.models.PagedOperation": "Azure.ResourceManager.Foundations.OperationListResult",
"azure.mgmt.spheredpg.models.Product": "Microsoft.AzureSphere.Product",
"azure.mgmt.spheredpg.models.ProductListResult": "Azure.ResourceManager.ResourceListResult",
"azure.mgmt.spheredpg.models.ProductProperties": "Microsoft.AzureSphere.ProductProperties",
"azure.mgmt.spheredpg.models.ProductUpdate": "Microsoft.AzureSphere.ProductUpdate",
"azure.mgmt.spheredpg.models.ProductUpdateProperties": "Microsoft.AzureSphere.ProductUpdateProperties",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,22 @@
# --------------------------------------------------------------------------

from ._models import Catalog
from ._models import CatalogListResult
from ._models import CatalogProperties
from ._models import CatalogUpdate
from ._models import Certificate
from ._models import CertificateChainResponse
from ._models import CertificateListResult
from ._models import CertificateProperties
from ._models import ClaimDevicesRequest
from ._models import CountDevicesResponse
from ._models import CountElementsResponse
from ._models import Deployment
from ._models import DeploymentListResult
from ._models import DeploymentProperties
from ._models import Device
from ._models import DeviceGroup
from ._models import DeviceGroupListResult
from ._models import DeviceGroupProperties
from ._models import DeviceGroupUpdate
from ._models import DeviceGroupUpdateProperties
from ._models import DeviceInsight
from ._models import DeviceListResult
from ._models import DeviceProperties
from ._models import DeviceUpdate
from ._models import DeviceUpdateProperties
Expand All @@ -36,15 +31,11 @@
from ._models import ErrorResponse
from ._models import GenerateCapabilityImageRequest
from ._models import Image
from ._models import ImageListResult
from ._models import ImageProperties
from ._models import ListDeviceGroupsRequest
from ._models import Operation
from ._models import OperationDisplay
from ._models import PagedDeviceInsight
from ._models import PagedOperation
from ._models import Product
from ._models import ProductListResult
from ._models import ProductProperties
from ._models import ProductUpdate
from ._models import ProductUpdateProperties
Expand Down Expand Up @@ -73,27 +64,22 @@

__all__ = [
"Catalog",
"CatalogListResult",
"CatalogProperties",
"CatalogUpdate",
"Certificate",
"CertificateChainResponse",
"CertificateListResult",
"CertificateProperties",
"ClaimDevicesRequest",
"CountDevicesResponse",
"CountElementsResponse",
"Deployment",
"DeploymentListResult",
"DeploymentProperties",
"Device",
"DeviceGroup",
"DeviceGroupListResult",
"DeviceGroupProperties",
"DeviceGroupUpdate",
"DeviceGroupUpdateProperties",
"DeviceInsight",
"DeviceListResult",
"DeviceProperties",
"DeviceUpdate",
"DeviceUpdateProperties",
Expand All @@ -102,15 +88,11 @@
"ErrorResponse",
"GenerateCapabilityImageRequest",
"Image",
"ImageListResult",
"ImageProperties",
"ListDeviceGroupsRequest",
"Operation",
"OperationDisplay",
"PagedDeviceInsight",
"PagedOperation",
"Product",
"ProductListResult",
"ProductProperties",
"ProductUpdate",
"ProductUpdateProperties",
Expand Down
Loading

0 comments on commit 92629d6

Please sign in to comment.