Skip to content

[AutoPR track2_azure-mgmt-agrifood] Update agfood.json #1727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
13 changes: 13 additions & 0 deletions cadl_to_sdk_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"dependencies": {
"@azure-tools/cadl-python": "0.4.16",
"@autorest/python": "6.2.15",
"@azure-tools/cadl-azure-core": "~0.24.0",
"@azure-tools/cadl-dpg": "~0.25.0-dev.8",
"@cadl-lang/compiler": "~0.38.5",
"@cadl-lang/eslint-config-cadl": "~0.5.0",
"@cadl-lang/openapi": "~0.38.0",
"@cadl-lang/rest": "~0.38.1",
"@cadl-lang/versioning": "~0.38.0"
}
}
6 changes: 3 additions & 3 deletions sdk/agrifood/azure-mgmt-agrifood/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "e37a57df67daaa82f9c3758fc450bc8655812a08",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"commit": "f3cf16a6ef63dbe34ed161385aff1410430b8dda",
"repository_url": "https://github.com/openapi-env-test/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/agrifood/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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/agrifood/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/[email protected] --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/agrifood/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._agri_food_mgmt_client import AgriFoodMgmtClient
from ._azure_agri_food_rp_service import AzureAgriFoodRPService
from ._version import VERSION

__version__ = VERSION
Expand All @@ -19,7 +19,7 @@
from ._patch import patch_sdk as _patch_sdk

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,23 @@
from azure.mgmt.core import ARMPipelineClient

from . import models as _models
from ._configuration import AgriFoodMgmtClientConfiguration
from ._configuration import AzureAgriFoodRPServiceConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
ExtensionsOperations,
FarmBeatsExtensionsOperations,
FarmBeatsModelsOperations,
LocationsOperations,
Operations,
PrivateEndpointConnectionsOperations,
PrivateLinkResourcesOperations,
SolutionsDiscoverabilityOperations,
SolutionsOperations,
)

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


class AgriFoodMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""APIs documentation for Azure AgFoodPlatform Resource Provider Service.
class AzureAgriFoodRPService: # pylint: disable=client-accepts-api-version-keyword
"""APIs documentation for Azure AgriFood Resource Provider Service.

:ivar extensions: ExtensionsOperations operations
:vartype extensions: azure.mgmt.agrifood.operations.ExtensionsOperations
Expand All @@ -45,41 +41,26 @@ class AgriFoodMgmtClient: # pylint: disable=client-accepts-api-version-keyword,
:vartype locations: azure.mgmt.agrifood.operations.LocationsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.agrifood.operations.Operations
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
:vartype private_endpoint_connections:
azure.mgmt.agrifood.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResourcesOperations operations
:vartype private_link_resources: azure.mgmt.agrifood.operations.PrivateLinkResourcesOperations
:ivar solutions: SolutionsOperations operations
:vartype solutions: azure.mgmt.agrifood.operations.SolutionsOperations
:ivar solutions_discoverability: SolutionsDiscoverabilityOperations operations
:vartype solutions_discoverability:
azure.mgmt.agrifood.operations.SolutionsDiscoverabilityOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param solution_id: Solution Id of the solution. Required.
:type solution_id: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
: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 "2021-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2020-05-12-preview". 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.
"""

def __init__(
self,
credential: "TokenCredential",
solution_id: str,
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AgriFoodMgmtClientConfiguration(
credential=credential, solution_id=solution_id, subscription_id=subscription_id, **kwargs
self._config = AzureAgriFoodRPServiceConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand All @@ -96,16 +77,6 @@ def __init__(
)
self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.private_link_resources = PrivateLinkResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.solutions = SolutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.solutions_discoverability = SolutionsDiscoverabilityOperations(
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.
Expand All @@ -132,7 +103,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
def close(self) -> None:
self._client.close()

def __enter__(self) -> "AgriFoodMgmtClient":
def __enter__(self) -> "AzureAgriFoodRPService":
self._client.__enter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,31 @@
from azure.core.credentials import TokenCredential


class AgriFoodMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for AgriFoodMgmtClient.
class AzureAgriFoodRPServiceConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for AzureAgriFoodRPService.

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. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param solution_id: Solution Id of the solution. Required.
:type solution_id: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2021-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2020-05-12-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(self, credential: "TokenCredential", solution_id: str, subscription_id: str, **kwargs: Any) -> None:
super(AgriFoodMgmtClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2021-09-01-preview"] = kwargs.pop("api_version", "2021-09-01-preview")
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(AzureAgriFoodRPServiceConfiguration, self).__init__(**kwargs)
api_version: Literal["2020-05-12-preview"] = kwargs.pop("api_version", "2020-05-12-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if solution_id is None:
raise ValueError("Parameter 'solution_id' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.solution_id = solution_id
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0b3"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from ._agri_food_mgmt_client import AgriFoodMgmtClient
from ._azure_agri_food_rp_service import AzureAgriFoodRPService

try:
from ._patch import __all__ as _patch_all
Expand All @@ -16,7 +16,7 @@
from ._patch import patch_sdk as _patch_sdk

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,22 @@

from .. import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import AgriFoodMgmtClientConfiguration
from ._configuration import AzureAgriFoodRPServiceConfiguration
from .operations import (
ExtensionsOperations,
FarmBeatsExtensionsOperations,
FarmBeatsModelsOperations,
LocationsOperations,
Operations,
PrivateEndpointConnectionsOperations,
PrivateLinkResourcesOperations,
SolutionsDiscoverabilityOperations,
SolutionsOperations,
)

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


class AgriFoodMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""APIs documentation for Azure AgFoodPlatform Resource Provider Service.
class AzureAgriFoodRPService: # pylint: disable=client-accepts-api-version-keyword
"""APIs documentation for Azure AgriFood Resource Provider Service.

:ivar extensions: ExtensionsOperations operations
:vartype extensions: azure.mgmt.agrifood.aio.operations.ExtensionsOperations
Expand All @@ -46,42 +42,26 @@ class AgriFoodMgmtClient: # pylint: disable=client-accepts-api-version-keyword,
:vartype locations: azure.mgmt.agrifood.aio.operations.LocationsOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.agrifood.aio.operations.Operations
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
:vartype private_endpoint_connections:
azure.mgmt.agrifood.aio.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResourcesOperations operations
:vartype private_link_resources:
azure.mgmt.agrifood.aio.operations.PrivateLinkResourcesOperations
:ivar solutions: SolutionsOperations operations
:vartype solutions: azure.mgmt.agrifood.aio.operations.SolutionsOperations
:ivar solutions_discoverability: SolutionsDiscoverabilityOperations operations
:vartype solutions_discoverability:
azure.mgmt.agrifood.aio.operations.SolutionsDiscoverabilityOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param solution_id: Solution Id of the solution. Required.
:type solution_id: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
: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 "2021-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2020-05-12-preview". 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.
"""

def __init__(
self,
credential: "AsyncTokenCredential",
solution_id: str,
subscription_id: str,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = AgriFoodMgmtClientConfiguration(
credential=credential, solution_id=solution_id, subscription_id=subscription_id, **kwargs
self._config = AzureAgriFoodRPServiceConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand All @@ -98,16 +78,6 @@ def __init__(
)
self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.private_link_resources = PrivateLinkResourcesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.solutions = SolutionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.solutions_discoverability = SolutionsDiscoverabilityOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
"""Runs the network request through the client's chained policies.
Expand All @@ -134,7 +104,7 @@ def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncH
async def close(self) -> None:
await self._client.close()

async def __aenter__(self) -> "AgriFoodMgmtClient":
async def __aenter__(self) -> "AzureAgriFoodRPService":
await self._client.__aenter__()
return self

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,31 @@
from azure.core.credentials_async import AsyncTokenCredential


class AgriFoodMgmtClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for AgriFoodMgmtClient.
class AzureAgriFoodRPServiceConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for AzureAgriFoodRPService.

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. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param solution_id: Solution Id of the solution. Required.
:type solution_id: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2021-09-01-preview". Note that overriding
:keyword api_version: Api Version. Default value is "2020-05-12-preview". Note that overriding
this default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self, credential: "AsyncTokenCredential", solution_id: str, subscription_id: str, **kwargs: Any
) -> None:
super(AgriFoodMgmtClientConfiguration, self).__init__(**kwargs)
api_version: Literal["2021-09-01-preview"] = kwargs.pop("api_version", "2021-09-01-preview")
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(AzureAgriFoodRPServiceConfiguration, self).__init__(**kwargs)
api_version: Literal["2020-05-12-preview"] = kwargs.pop("api_version", "2020-05-12-preview")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if solution_id is None:
raise ValueError("Parameter 'solution_id' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.solution_id = solution_id
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
from ._farm_beats_models_operations import FarmBeatsModelsOperations
from ._locations_operations import LocationsOperations
from ._operations import Operations
from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations
from ._private_link_resources_operations import PrivateLinkResourcesOperations
from ._solutions_operations import SolutionsOperations
from ._solutions_discoverability_operations import SolutionsDiscoverabilityOperations

from ._patch import __all__ as _patch_all
from ._patch import * # pylint: disable=unused-wildcard-import
Expand All @@ -26,10 +22,6 @@
"FarmBeatsModelsOperations",
"LocationsOperations",
"Operations",
"PrivateEndpointConnectionsOperations",
"PrivateLinkResourcesOperations",
"SolutionsOperations",
"SolutionsDiscoverabilityOperations",
]
__all__.extend([p for p in _patch_all if p not in __all__])
_patch_sdk()
Loading