Skip to content

Commit

Permalink
CodeGen from PR 25977 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 4480ade6f920655409fe1670b6a272007e179e75 into 0a25ea9680cf080b7d34e8c5f35f564425c6b1f7
  • Loading branch information
SDKAuto committed Oct 17, 2023
1 parent 97a5574 commit 8a230a4
Show file tree
Hide file tree
Showing 73 changed files with 13,127 additions and 160 deletions.
4 changes: 2 additions & 2 deletions sdk/apicenter/azure-mgmt-apicenter/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "1d2b8c05b55be5dd98ce94c835d7e96ee1ea7f5d",
"commit": "da78886f03e18f0f1f3733090410382781060a1f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.7",
"use": [
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/apicenter/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.7 --version-tolerant=False",
"autorest_command": "autorest specification/apicenter/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.7 --version-tolerant=False",
"readme": "specification/apicenter/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,106 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models as _models
from ._configuration import ApiCenterMgmtClientConfiguration
from ._serialization import Deserializer, Serializer
from .operations import Operations, ServicesOperations
from .operations import (
ApiDefinitionsOperations,
ApiVersionsOperations,
ApisOperations,
DeploymentsOperations,
EnvironmentsOperations,
MetadataSchemasOperations,
Operations,
ServicesOperations,
WorkspacesOperations,
)

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


class ApiCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
class ApiCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""Azure API Center Resource Provider.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.apicenter.operations.Operations
:ivar services: ServicesOperations operations
:vartype services: azure.mgmt.apicenter.operations.ServicesOperations
:ivar metadata_schemas: MetadataSchemasOperations operations
:vartype metadata_schemas: azure.mgmt.apicenter.operations.MetadataSchemasOperations
:ivar workspaces: WorkspacesOperations operations
:vartype workspaces: azure.mgmt.apicenter.operations.WorkspacesOperations
:ivar apis: ApisOperations operations
:vartype apis: azure.mgmt.apicenter.operations.ApisOperations
:ivar api_versions: ApiVersionsOperations operations
:vartype api_versions: azure.mgmt.apicenter.operations.ApiVersionsOperations
:ivar api_definitions: ApiDefinitionsOperations operations
:vartype api_definitions: azure.mgmt.apicenter.operations.ApiDefinitionsOperations
:ivar deployments: DeploymentsOperations operations
:vartype deployments: azure.mgmt.apicenter.operations.DeploymentsOperations
:ivar environments: EnvironmentsOperations operations
:vartype environments: azure.mgmt.apicenter.operations.EnvironmentsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param api_name: The name of the API. Required.
:type api_name: str
:param version_name: The name of the API version. Required.
:type version_name: str
:param definition_name: The name of the API definition. Required.
:type definition_name: str
:param deployment_name: The name of the API deployment. Required.
:type deployment_name: str
:param environment_name: The name of the environment. Required.
:type environment_name: str
:param metadata_schema_name: The name of the metadata schema. Required.
:type metadata_schema_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param filter: OData filter parameter. Default value is None.
:type filter: 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 "2023-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2024-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
credential: "TokenCredential",
api_name: str,
version_name: str,
definition_name: str,
deployment_name: str,
environment_name: str,
metadata_schema_name: str,
workspace_name: str,
subscription_id: str,
filter: Optional[str] = None,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ApiCenterMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
credential=credential,
api_name=api_name,
version_name=version_name,
definition_name=definition_name,
deployment_name=deployment_name,
environment_name=environment_name,
metadata_schema_name=metadata_schema_name,
workspace_name=workspace_name,
subscription_id=subscription_id,
filter=filter,
**kwargs
)
self._client: ARMPipelineClient = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand All @@ -58,6 +116,15 @@ def __init__(
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize)
self.metadata_schemas = MetadataSchemasOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize)
self.apis = ApisOperations(self._client, self._config, self._serialize, self._deserialize)
self.api_versions = ApiVersionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.api_definitions = ApiDefinitionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.environments = EnvironmentsOperations(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 Down
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 typing import Any, TYPE_CHECKING
from typing import Any, Optional, TYPE_CHECKING

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
Expand All @@ -27,24 +27,75 @@ class ApiCenterMgmtClientConfiguration(Configuration): # pylint: disable=too-ma
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param api_name: The name of the API. Required.
:type api_name: str
:param version_name: The name of the API version. Required.
:type version_name: str
:param definition_name: The name of the API definition. Required.
:type definition_name: str
:param deployment_name: The name of the API deployment. Required.
:type deployment_name: str
:param environment_name: The name of the environment. Required.
:type environment_name: str
:param metadata_schema_name: The name of the metadata schema. Required.
:type metadata_schema_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2023-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:param filter: OData filter parameter. Default value is None.
:type filter: str
:keyword api_version: Api Version. Default value is "2024-03-01". 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:
def __init__(
self,
credential: "TokenCredential",
api_name: str,
version_name: str,
definition_name: str,
deployment_name: str,
environment_name: str,
metadata_schema_name: str,
workspace_name: str,
subscription_id: str,
filter: Optional[str] = None,
**kwargs: Any
) -> None:
super(ApiCenterMgmtClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2023-07-01-preview")
api_version: str = kwargs.pop("api_version", "2024-03-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if api_name is None:
raise ValueError("Parameter 'api_name' must not be None.")
if version_name is None:
raise ValueError("Parameter 'version_name' must not be None.")
if definition_name is None:
raise ValueError("Parameter 'definition_name' must not be None.")
if deployment_name is None:
raise ValueError("Parameter 'deployment_name' must not be None.")
if environment_name is None:
raise ValueError("Parameter 'environment_name' must not be None.")
if metadata_schema_name is None:
raise ValueError("Parameter 'metadata_schema_name' must not be None.")
if workspace_name is None:
raise ValueError("Parameter 'workspace_name' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

self.credential = credential
self.api_name = api_name
self.version_name = version_name
self.definition_name = definition_name
self.deployment_name = deployment_name
self.environment_name = environment_name
self.metadata_schema_name = metadata_schema_name
self.workspace_name = workspace_name
self.subscription_id = subscription_id
self.filter = filter
self.api_version = api_version
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-apicenter/{}".format(VERSION))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,106 @@
# --------------------------------------------------------------------------

from copy import deepcopy
from typing import Any, Awaitable, TYPE_CHECKING
from typing import Any, Awaitable, Optional, TYPE_CHECKING

from azure.core.rest import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient

from .. import models as _models
from .._serialization import Deserializer, Serializer
from ._configuration import ApiCenterMgmtClientConfiguration
from .operations import Operations, ServicesOperations
from .operations import (
ApiDefinitionsOperations,
ApiVersionsOperations,
ApisOperations,
DeploymentsOperations,
EnvironmentsOperations,
MetadataSchemasOperations,
Operations,
ServicesOperations,
WorkspacesOperations,
)

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


class ApiCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword
class ApiCenterMgmtClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""Azure API Center Resource Provider.
:ivar operations: Operations operations
:vartype operations: azure.mgmt.apicenter.aio.operations.Operations
:ivar services: ServicesOperations operations
:vartype services: azure.mgmt.apicenter.aio.operations.ServicesOperations
:ivar metadata_schemas: MetadataSchemasOperations operations
:vartype metadata_schemas: azure.mgmt.apicenter.aio.operations.MetadataSchemasOperations
:ivar workspaces: WorkspacesOperations operations
:vartype workspaces: azure.mgmt.apicenter.aio.operations.WorkspacesOperations
:ivar apis: ApisOperations operations
:vartype apis: azure.mgmt.apicenter.aio.operations.ApisOperations
:ivar api_versions: ApiVersionsOperations operations
:vartype api_versions: azure.mgmt.apicenter.aio.operations.ApiVersionsOperations
:ivar api_definitions: ApiDefinitionsOperations operations
:vartype api_definitions: azure.mgmt.apicenter.aio.operations.ApiDefinitionsOperations
:ivar deployments: DeploymentsOperations operations
:vartype deployments: azure.mgmt.apicenter.aio.operations.DeploymentsOperations
:ivar environments: EnvironmentsOperations operations
:vartype environments: azure.mgmt.apicenter.aio.operations.EnvironmentsOperations
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
:param subscription_id: The ID of the target subscription. Required.
:param api_name: The name of the API. Required.
:type api_name: str
:param version_name: The name of the API version. Required.
:type version_name: str
:param definition_name: The name of the API definition. Required.
:type definition_name: str
:param deployment_name: The name of the API deployment. Required.
:type deployment_name: str
:param environment_name: The name of the environment. Required.
:type environment_name: str
:param metadata_schema_name: The name of the metadata schema. Required.
:type metadata_schema_name: str
:param workspace_name: The name of the workspace. Required.
:type workspace_name: str
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
:type subscription_id: str
:param filter: OData filter parameter. Default value is None.
:type filter: 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 "2023-07-01-preview". Note that overriding
this default value may result in unsupported behavior.
:keyword api_version: Api Version. Default value is "2024-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
credential: "AsyncTokenCredential",
api_name: str,
version_name: str,
definition_name: str,
deployment_name: str,
environment_name: str,
metadata_schema_name: str,
workspace_name: str,
subscription_id: str,
filter: Optional[str] = None,
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ApiCenterMgmtClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
credential=credential,
api_name=api_name,
version_name=version_name,
definition_name=definition_name,
deployment_name=deployment_name,
environment_name=environment_name,
metadata_schema_name=metadata_schema_name,
workspace_name=workspace_name,
subscription_id=subscription_id,
filter=filter,
**kwargs
)
self._client: AsyncARMPipelineClient = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

Expand All @@ -58,6 +116,15 @@ def __init__(
self._serialize.client_side_validation = False
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.services = ServicesOperations(self._client, self._config, self._serialize, self._deserialize)
self.metadata_schemas = MetadataSchemasOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.workspaces = WorkspacesOperations(self._client, self._config, self._serialize, self._deserialize)
self.apis = ApisOperations(self._client, self._config, self._serialize, self._deserialize)
self.api_versions = ApiVersionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.api_definitions = ApiDefinitionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.deployments = DeploymentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.environments = EnvironmentsOperations(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 Down
Loading

0 comments on commit 8a230a4

Please sign in to comment.