Skip to content

Commit

Permalink
CodeGen from PR 13932 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Public private branch 'add-ingressStartAt' (Azure#13932)

* add ingressStartAt

* prettier

* add a new example

* Delete .npmrc

remove .npmrc

* fix prettier

fix prettier

* put readonly back for kind

* Adding descriptin to ingressStartAt

* fix failure for python track2

* Removing readonly from kind

Co-authored-by: Go Blue <zth@umich.edu>
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 15, 2021
1 parent ad92392 commit 52c511c
Show file tree
Hide file tree
Showing 16 changed files with 531 additions and 100 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
11 changes: 11 additions & 0 deletions sdk/timeseriesinsights/azure-mgmt-timeseriesinsights/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.0",
"@autorest/modelerfour@4.19.2"
],
"commit": "735587512f6d422ba40d1b521ac176e7dc018ae1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/timeseriesinsights/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"readme": "specification/timeseriesinsights/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"chosen_version": "2020-05-15",
"total_api_version_list": ["2020-05-15"],
"client": {
"name": "TimeSeriesInsightsClient",
"filename": "_time_series_insights_client",
"description": "Time Series Insights client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"TimeSeriesInsightsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"TimeSeriesInsightsClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
"credential": {
"signature": "credential, # type: \"TokenCredential\"",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials.TokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"description": "Azure Subscription ID.",
"docstring_type": "str",
"required": true
}
},
"async": {
"credential": {
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id: str,",
"description": "Azure Subscription ID.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"operations": "Operations",
"environments": "EnvironmentsOperations",
"event_sources": "EventSourcesOperations",
"reference_data_sets": "ReferenceDataSetsOperations",
"access_policies": "AccessPoliciesOperations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import TimeSeriesInsightsClientConfiguration
from .operations import Operations
Expand Down Expand Up @@ -76,6 +77,24 @@ def __init__(
self.access_policies = AccessPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
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.0"
VERSION = "0.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand Down Expand Up @@ -73,6 +74,23 @@ def __init__(
self.access_policies = AccessPoliciesOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def create_or_update(
environment_name: str,
access_policy_name: str,
parameters: "_models.AccessPolicyCreateOrUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.AccessPolicyResource":
"""Create or update an access policy in the specified environment.
Expand Down Expand Up @@ -120,7 +120,7 @@ async def get(
resource_group_name: str,
environment_name: str,
access_policy_name: str,
**kwargs
**kwargs: Any
) -> "_models.AccessPolicyResource":
"""Gets the access policy with the specified name in the specified environment.
Expand Down Expand Up @@ -185,7 +185,7 @@ async def update(
environment_name: str,
access_policy_name: str,
access_policy_update_parameters: "_models.AccessPolicyUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.AccessPolicyResource":
"""Updates the access policy with the specified name in the specified subscription, resource
group, and environment.
Expand Down Expand Up @@ -258,7 +258,7 @@ async def delete(
resource_group_name: str,
environment_name: str,
access_policy_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Deletes the access policy with the specified name in the specified subscription, resource
group, and environment.
Expand Down Expand Up @@ -319,7 +319,7 @@ async def list_by_environment(
self,
resource_group_name: str,
environment_name: str,
**kwargs
**kwargs: Any
) -> "_models.AccessPolicyListResponse":
"""Lists all the available access policies associated with the environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def _create_or_update_initial(
resource_group_name: str,
environment_name: str,
parameters: "_models.EnvironmentCreateOrUpdateParameters",
**kwargs
**kwargs: Any
) -> Optional["_models.EnvironmentResource"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.EnvironmentResource"]]
error_map = {
Expand Down Expand Up @@ -105,7 +105,7 @@ async def begin_create_or_update(
resource_group_name: str,
environment_name: str,
parameters: "_models.EnvironmentCreateOrUpdateParameters",
**kwargs
**kwargs: Any
) -> AsyncLROPoller["_models.EnvironmentResource"]:
"""Create or update an environment in the specified subscription and resource group.
Expand All @@ -117,8 +117,8 @@ async def begin_create_or_update(
:type parameters: ~azure.mgmt.timeseriesinsights.models.EnvironmentCreateOrUpdateParameters
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either EnvironmentResource or the result of cls(response)
Expand Down Expand Up @@ -176,7 +176,7 @@ async def get(
resource_group_name: str,
environment_name: str,
expand: Optional[str] = None,
**kwargs
**kwargs: Any
) -> "_models.EnvironmentResource":
"""Gets the environment with the specified name in the specified subscription and resource group.
Expand Down Expand Up @@ -241,7 +241,7 @@ async def _update_initial(
resource_group_name: str,
environment_name: str,
environment_update_parameters: "_models.EnvironmentUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.EnvironmentResource":
cls = kwargs.pop('cls', None) # type: ClsType["_models.EnvironmentResource"]
error_map = {
Expand Down Expand Up @@ -294,7 +294,7 @@ async def begin_update(
resource_group_name: str,
environment_name: str,
environment_update_parameters: "_models.EnvironmentUpdateParameters",
**kwargs
**kwargs: Any
) -> AsyncLROPoller["_models.EnvironmentResource"]:
"""Updates the environment with the specified name in the specified subscription and resource
group.
Expand All @@ -309,8 +309,8 @@ async def begin_update(
:type environment_update_parameters: ~azure.mgmt.timeseriesinsights.models.EnvironmentUpdateParameters
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:keyword polling: By default, your polling method will be AsyncARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncLROPoller that returns either EnvironmentResource or the result of cls(response)
Expand Down Expand Up @@ -367,7 +367,7 @@ async def delete(
self,
resource_group_name: str,
environment_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Deletes the environment with the specified name in the specified subscription and resource
group.
Expand Down Expand Up @@ -423,7 +423,7 @@ async def delete(
async def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
**kwargs: Any
) -> "_models.EnvironmentListResponse":
"""Lists all the available environments associated with the subscription and within the specified
resource group.
Expand Down Expand Up @@ -477,7 +477,7 @@ async def list_by_resource_group(

async def list_by_subscription(
self,
**kwargs
**kwargs: Any
) -> "_models.EnvironmentListResponse":
"""Lists all the available environments within a subscription, irrespective of the resource
groups.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def create_or_update(
environment_name: str,
event_source_name: str,
parameters: "_models.EventSourceCreateOrUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.EventSourceResource":
"""Create or update an event source under the specified environment.
Expand Down Expand Up @@ -120,7 +120,7 @@ async def get(
resource_group_name: str,
environment_name: str,
event_source_name: str,
**kwargs
**kwargs: Any
) -> "_models.EventSourceResource":
"""Gets the event source with the specified name in the specified environment.
Expand Down Expand Up @@ -185,7 +185,7 @@ async def update(
environment_name: str,
event_source_name: str,
event_source_update_parameters: "_models.EventSourceUpdateParameters",
**kwargs
**kwargs: Any
) -> "_models.EventSourceResource":
"""Updates the event source with the specified name in the specified subscription, resource group,
and environment.
Expand Down Expand Up @@ -258,7 +258,7 @@ async def delete(
resource_group_name: str,
environment_name: str,
event_source_name: str,
**kwargs
**kwargs: Any
) -> None:
"""Deletes the event source with the specified name in the specified subscription, resource group,
and environment.
Expand Down Expand Up @@ -319,7 +319,7 @@ async def list_by_environment(
self,
resource_group_name: str,
environment_name: str,
**kwargs
**kwargs: Any
) -> "_models.EventSourceListResponse":
"""Lists all the available event sources associated with the subscription and within the specified
resource group and environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

def list(
self,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.OperationListResult"]:
"""Lists all of the available Time Series Insights related operations.
Expand Down
Loading

0 comments on commit 52c511c

Please sign in to comment.