Skip to content
Closed
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
4 changes: 2 additions & 2 deletions sdk/iotoperations/azure-mgmt-iotoperations/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"commit": "ab67c148ec716a0d0075770742d54468f128c72e",
"commit": "b94f2ee129331ceee9dabf8c875e9ce9e9933b48",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"typespec_src": "specification/iotoperations/IoTOperations.Management",
"@azure-tools/typespec-python": "0.37.0"
"@azure-tools/typespec-python": "0.38.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,73 +185,7 @@ def deserialize_from_http_generics(cls, body_bytes: Optional[Union[AnyStr, IO]],
except NameError:
_long_type = int


class UTC(datetime.tzinfo):
"""Time Zone info for handling UTC"""

def utcoffset(self, dt):
"""UTF offset for UTC is 0.

:param datetime.datetime dt: The datetime
:returns: The offset
:rtype: datetime.timedelta
"""
return datetime.timedelta(0)

def tzname(self, dt):
"""Timestamp representation.

:param datetime.datetime dt: The datetime
:returns: The timestamp representation
:rtype: str
"""
return "Z"

def dst(self, dt):
"""No daylight saving for UTC.

:param datetime.datetime dt: The datetime
:returns: The daylight saving time
:rtype: datetime.timedelta
"""
return datetime.timedelta(hours=1)


try:
from datetime import timezone as _FixedOffset # type: ignore
except ImportError: # Python 2.7

class _FixedOffset(datetime.tzinfo): # type: ignore
"""Fixed offset in minutes east from UTC.
Copy/pasted from Python doc
:param datetime.timedelta offset: offset in timedelta format
"""

def __init__(self, offset) -> None:
self.__offset = offset

def utcoffset(self, dt):
return self.__offset

def tzname(self, dt):
return str(self.__offset.total_seconds() / 3600)

def __repr__(self):
return "<FixedOffset {}>".format(self.tzname(None))

def dst(self, dt):
return datetime.timedelta(0)

def __getinitargs__(self):
return (self.__offset,)


try:
from datetime import timezone

TZ_UTC = timezone.utc
except ImportError:
TZ_UTC = UTC() # type: ignore
TZ_UTC = datetime.timezone.utc

_FLATTEN = re.compile(r"(?<!\\)\.")

Expand Down Expand Up @@ -2051,7 +1985,7 @@ def deserialize_rfc(attr):
try:
parsed_date = email.utils.parsedate_tz(attr) # type: ignore
date_obj = datetime.datetime(
*parsed_date[:6], tzinfo=_FixedOffset(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60))
*parsed_date[:6], tzinfo=datetime.timezone(datetime.timedelta(minutes=(parsed_date[9] or 0) / 60))
)
if not date_obj.tzinfo:
date_obj = date_obj.astimezone(tz=TZ_UTC)
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 = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, List, Optional, TypeVar, Union, cast, overload
import urllib.parse

from azure.core import AsyncPipelineClient
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
Expand All @@ -34,6 +35,7 @@

from ... import models as _models
from ..._model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize
from ..._serialization import Deserializer, Serializer
from ...operations._operations import (
build_broker_authentication_create_or_update_request,
build_broker_authentication_delete_request,
Expand Down Expand Up @@ -71,6 +73,7 @@
build_instance_update_request,
build_operations_list_request,
)
from .._configuration import IoTOperationsMgmtClientConfiguration

if sys.version_info >= (3, 9):
from collections.abc import MutableMapping
Expand All @@ -93,10 +96,10 @@ class Operations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace
def list(self, **kwargs: Any) -> AsyncIterable["_models.Operation"]:
Expand Down Expand Up @@ -194,10 +197,10 @@ class InstanceOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(self, resource_group_name: str, instance_name: str, **kwargs: Any) -> _models.InstanceResource:
Expand Down Expand Up @@ -966,10 +969,10 @@ class BrokerOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(
Expand Down Expand Up @@ -1516,10 +1519,10 @@ class BrokerListenerOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(
Expand Down Expand Up @@ -2095,10 +2098,10 @@ class BrokerAuthenticationOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(
Expand Down Expand Up @@ -2676,10 +2679,10 @@ class BrokerAuthorizationOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(
Expand Down Expand Up @@ -3257,10 +3260,10 @@ class DataflowProfileOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(
Expand Down Expand Up @@ -3811,10 +3814,10 @@ class DataflowOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(
Expand Down Expand Up @@ -4401,10 +4404,10 @@ class DataflowEndpointOperations:

def __init__(self, *args, **kwargs) -> None:
input_args = list(args)
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client")
self._config: IoTOperationsMgmtClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config")
self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer")
self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer")

@distributed_trace_async
async def get(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1693,8 +1693,8 @@ class DataflowEndpointDataExplorer(_model_base.Model):
~azure.mgmt.iotoperations.models.DataflowEndpointDataExplorerAuthentication
:ivar database: Database name. Required.
:vartype database: str
:ivar host: Host of the Azure Data Explorer in the form of
:code:`<cluster>`.:code:`<region>`.kusto.windows.net . Required.
:ivar host: Host of the Azure Data Explorer in the form of :code:`<cluster>`.\\
:code:`<region>`.kusto.windows.net . Required.
:vartype host: str
:ivar batching: Azure Data Explorer endpoint batching configuration.
:vartype batching: ~azure.mgmt.iotoperations.models.BatchingConfiguration
Expand All @@ -1706,8 +1706,8 @@ class DataflowEndpointDataExplorer(_model_base.Model):
database: str = rest_field()
"""Database name. Required."""
host: str = rest_field()
"""Host of the Azure Data Explorer in the form of
:code:`<cluster>`.:code:`<region>`.kusto.windows.net . Required."""
"""Host of the Azure Data Explorer in the form of :code:`<cluster>`.\
:code:`<region>`.kusto.windows.net . Required."""
batching: Optional["_models.BatchingConfiguration"] = rest_field()
"""Azure Data Explorer endpoint batching configuration."""

Expand Down Expand Up @@ -1903,8 +1903,8 @@ class DataflowEndpointFabricOneLake(_model_base.Model):
or files. Required. Known values are: "Files" and "Tables".
:vartype one_lake_path_type: str or
~azure.mgmt.iotoperations.models.DataflowEndpointFabricPathType
:ivar host: Host of the Microsoft Fabric in the form of
https://:code:`<host>`.fabric.microsoft.com. Required.
:ivar host: Host of the Microsoft Fabric in the form of https://\\
:code:`<host>`.fabric.microsoft.com. Required.
:vartype host: str
:ivar batching: Batching configuration.
:vartype batching: ~azure.mgmt.iotoperations.models.BatchingConfiguration
Expand All @@ -1919,7 +1919,7 @@ class DataflowEndpointFabricOneLake(_model_base.Model):
"""Type of location of the data in the workspace. Can be either tables or files. Required. Known
values are: \"Files\" and \"Tables\"."""
host: str = rest_field()
"""Host of the Microsoft Fabric in the form of https://:code:`<host>`.fabric.microsoft.com.
"""Host of the Microsoft Fabric in the form of https://\ :code:`<host>`.fabric.microsoft.com.
Required."""
batching: Optional["_models.BatchingConfiguration"] = rest_field()
"""Batching configuration."""
Expand Down Expand Up @@ -2275,7 +2275,7 @@ class DataflowEndpointMqtt(_model_base.Model):
:ivar client_id_prefix: Client ID prefix. Client ID generated by the dataflow is
:code:`<prefix>`-TBD. Optional; no prefix if omitted.
:vartype client_id_prefix: str
:ivar host: Host of the Broker in the form of :code:`<hostname>`::code:`<port>`. Optional;
:ivar host: Host of the Broker in the form of :code:`<hostname>`:\\ :code:`<port>`. Optional;
connects to Broker if omitted.
:vartype host: str
:ivar protocol: Enable or disable websockets. Known values are: "Mqtt" and "WebSockets".
Expand Down Expand Up @@ -2307,7 +2307,7 @@ class DataflowEndpointMqtt(_model_base.Model):
"""Client ID prefix. Client ID generated by the dataflow is :code:`<prefix>`-TBD. Optional; no
prefix if omitted."""
host: Optional[str] = rest_field()
"""Host of the Broker in the form of :code:`<hostname>`::code:`<port>`. Optional; connects to
"""Host of the Broker in the form of :code:`<hostname>`:\ :code:`<port>`. Optional; connects to
Broker if omitted."""
protocol: Optional[Union[str, "_models.BrokerProtocolType"]] = rest_field()
"""Enable or disable websockets. Known values are: \"Mqtt\" and \"WebSockets\"."""
Expand Down Expand Up @@ -3566,21 +3566,21 @@ class Operation(_model_base.Model):
is_data_action: Optional[bool] = rest_field(name="isDataAction", visibility=["read"])
"""Whether the operation applies to data-plane. This is \"true\" for data-plane operations and
\"false\" for Azure Resource Manager/control-plane operations."""
display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"])
display: Optional["_models.OperationDisplay"] = rest_field()
"""Localized display information for this particular operation."""
origin: Optional[Union[str, "_models.Origin"]] = rest_field(visibility=["read"])
"""The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit
logs UX. Default value is \"user,system\". Known values are: \"user\", \"system\", and
\"user,system\"."""
action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType")
action_type: Optional[Union[str, "_models.ActionType"]] = rest_field(name="actionType", visibility=["read"])
"""Extensible enum. Indicates the action type. \"Internal\" refers to actions that are for
internal only APIs. \"Internal\""""

@overload
def __init__(
self,
*,
action_type: Optional[Union[str, "_models.ActionType"]] = None,
display: Optional["_models.OperationDisplay"] = None,
) -> None: ...

@overload
Expand Down
Loading
Loading