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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict

from ... import models as _models
from ... import models as _models, types as _types
from ..._utils.model_base import SdkJSONEncoder, _deserialize
from ..._utils.serialization import Deserializer, Serializer
from ...operations._operations import (
Expand All @@ -39,7 +39,6 @@
)
from .._configuration import AlternateTypeClientConfiguration

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]]

Expand Down Expand Up @@ -244,11 +243,13 @@ async def put_property(
"""

@overload
async def put_property(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None:
async def put_property(
self, body: _types.ModelWithFeatureProperty, *, content_type: str = "application/json", **kwargs: Any
) -> None:
"""put_property.

:param body: Required.
:type body: JSON
:type body: ~specs.azure.clientgenerator.core.alternatetype.types.ModelWithFeatureProperty
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -272,12 +273,14 @@ async def put_property(self, body: IO[bytes], *, content_type: str = "applicatio
"""

@distributed_trace_async
async def put_property(self, body: Union[_models.ModelWithFeatureProperty, JSON, IO[bytes]], **kwargs: Any) -> None:
async def put_property(
self, body: Union[_models.ModelWithFeatureProperty, _types.ModelWithFeatureProperty, IO[bytes]], **kwargs: Any
) -> None:
"""put_property.

:param body: Is one of the following types: ModelWithFeatureProperty, JSON, IO[bytes] Required.
:param body: Is either a ModelWithFeatureProperty type or a IO[bytes] type. Required.
:type body: ~specs.azure.clientgenerator.core.alternatetype.models.ModelWithFeatureProperty or
JSON or IO[bytes]
~specs.azure.clientgenerator.core.alternatetype.types.ModelWithFeatureProperty or IO[bytes]
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,11 @@
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict

from .. import models as _models
from .. import models as _models, types as _types
from .._configuration import AlternateTypeClientConfiguration
from .._utils.model_base import SdkJSONEncoder, _deserialize
from .._utils.serialization import Deserializer, Serializer

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]]

Expand Down Expand Up @@ -296,11 +295,13 @@ def put_property(
"""

@overload
def put_property(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> None:
def put_property(
self, body: _types.ModelWithFeatureProperty, *, content_type: str = "application/json", **kwargs: Any
) -> None:
"""put_property.

:param body: Required.
:type body: JSON
:type body: ~specs.azure.clientgenerator.core.alternatetype.types.ModelWithFeatureProperty
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -325,13 +326,13 @@ def put_property(self, body: IO[bytes], *, content_type: str = "application/json

@distributed_trace
def put_property( # pylint: disable=inconsistent-return-statements
self, body: Union[_models.ModelWithFeatureProperty, JSON, IO[bytes]], **kwargs: Any
self, body: Union[_models.ModelWithFeatureProperty, _types.ModelWithFeatureProperty, IO[bytes]], **kwargs: Any
) -> None:
"""put_property.

:param body: Is one of the following types: ModelWithFeatureProperty, JSON, IO[bytes] Required.
:param body: Is either a ModelWithFeatureProperty type or a IO[bytes] type. Required.
:type body: ~specs.azure.clientgenerator.core.alternatetype.models.ModelWithFeatureProperty or
JSON or IO[bytes]
~specs.azure.clientgenerator.core.alternatetype.types.ModelWithFeatureProperty or IO[bytes]
:return: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing_extensions import Required, TypedDict

import geojson


class Geometry(TypedDict, total=False):
"""Geometry.

:ivar type: Required.
:vartype type: str
:ivar coordinates: Required.
:vartype coordinates: list[float]
"""

type: Required[str]
"""Required."""
coordinates: Required[list[float]]
"""Required."""


class ModelWithFeatureProperty(TypedDict, total=False):
"""ModelWithFeatureProperty.

:ivar feature: Required.
:vartype feature: geojson.Feature
:ivar additional_property: Required.
:vartype additional_property: str
"""

feature: Required[geojson.Feature]
"""Required."""
additionalProperty: Required[str]
"""Required."""
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict

from .. import models as _models
from .. import models as _models, types as _types
from .._configuration import ClientDefaultValueClientConfiguration
from .._utils.model_base import SdkJSONEncoder, _deserialize
from .._utils.serialization import Serializer
from .._utils.utils import ClientMixinABC

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]]

Expand Down Expand Up @@ -133,12 +132,12 @@ def put_model_property(

@overload
def put_model_property(
self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
self, body: _types.ModelWithDefaultValues, *, content_type: str = "application/json", **kwargs: Any
) -> _models.ModelWithDefaultValues:
"""put_model_property.

:param body: Required.
:type body: JSON
:type body: ~specs.azure.clientgenerator.core.clientdefaultvalue.types.ModelWithDefaultValues
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -165,13 +164,14 @@ def put_model_property(

@distributed_trace
def put_model_property(
self, body: Union[_models.ModelWithDefaultValues, JSON, IO[bytes]], **kwargs: Any
self, body: Union[_models.ModelWithDefaultValues, _types.ModelWithDefaultValues, IO[bytes]], **kwargs: Any
) -> _models.ModelWithDefaultValues:
"""put_model_property.

:param body: Is one of the following types: ModelWithDefaultValues, JSON, IO[bytes] Required.
:param body: Is either a ModelWithDefaultValues type or a IO[bytes] type. Required.
:type body: ~specs.azure.clientgenerator.core.clientdefaultvalue.models.ModelWithDefaultValues
or JSON or IO[bytes]
or ~specs.azure.clientgenerator.core.clientdefaultvalue.types.ModelWithDefaultValues or
IO[bytes]
:return: ModelWithDefaultValues. The ModelWithDefaultValues is compatible with MutableMapping
:rtype: ~specs.azure.clientgenerator.core.clientdefaultvalue.models.ModelWithDefaultValues
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict

from ... import models as _models
from ... import models as _models, types as _types
from ..._operations._operations import (
build_client_default_value_get_header_parameter_request,
build_client_default_value_get_operation_parameter_request,
Expand All @@ -38,7 +38,6 @@
from ..._utils.utils import ClientMixinABC
from .._configuration import ClientDefaultValueClientConfiguration

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]]

Expand All @@ -65,12 +64,12 @@ async def put_model_property(

@overload
async def put_model_property(
self, body: JSON, *, content_type: str = "application/json", **kwargs: Any
self, body: _types.ModelWithDefaultValues, *, content_type: str = "application/json", **kwargs: Any
) -> _models.ModelWithDefaultValues:
"""put_model_property.

:param body: Required.
:type body: JSON
:type body: ~specs.azure.clientgenerator.core.clientdefaultvalue.types.ModelWithDefaultValues
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -97,13 +96,14 @@ async def put_model_property(

@distributed_trace_async
async def put_model_property(
self, body: Union[_models.ModelWithDefaultValues, JSON, IO[bytes]], **kwargs: Any
self, body: Union[_models.ModelWithDefaultValues, _types.ModelWithDefaultValues, IO[bytes]], **kwargs: Any
) -> _models.ModelWithDefaultValues:
"""put_model_property.

:param body: Is one of the following types: ModelWithDefaultValues, JSON, IO[bytes] Required.
:param body: Is either a ModelWithDefaultValues type or a IO[bytes] type. Required.
:type body: ~specs.azure.clientgenerator.core.clientdefaultvalue.models.ModelWithDefaultValues
or JSON or IO[bytes]
or ~specs.azure.clientgenerator.core.clientdefaultvalue.types.ModelWithDefaultValues or
IO[bytes]
:return: ModelWithDefaultValues. The ModelWithDefaultValues is compatible with MutableMapping
:rtype: ~specs.azure.clientgenerator.core.clientdefaultvalue.models.ModelWithDefaultValues
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing_extensions import Required, TypedDict


class ModelWithDefaultValues(TypedDict, total=False):
"""Model with client default values on properties.

:ivar name: Name property with no default value. Required.
:vartype name: str
:ivar timeout: Timeout property with client default value of 30.
:vartype timeout: int
:ivar tier: Tier property with client default value of 'standard'.
:vartype tier: str
:ivar retry: Retry property with client default value of true.
:vartype retry: bool
"""

name: Required[str]
"""Name property with no default value. Required."""
timeout: int
"""Timeout property with client default value of 30."""
tier: str
"""Tier property with client default value of 'standard'."""
retry: bool
"""Retry property with client default value of true."""
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@
from azure.core.tracing.decorator_async import distributed_trace_async
from azure.core.utils import case_insensitive_dict

from ... import models as _models
from ... import models as _models, types as _types
from ..._utils.model_base import SdkJSONEncoder, _deserialize
from ..._utils.serialization import Deserializer, Serializer
from ...operations._operations import build_documentation_harvest_request
from .._configuration import ClientDocClientConfiguration

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]]

Expand Down Expand Up @@ -71,11 +70,13 @@ async def harvest(
"""

@overload
async def harvest(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Plant:
async def harvest(
self, body: _types.Plant, *, content_type: str = "application/json", **kwargs: Any
) -> _models.Plant:
"""Retrieves a plant from the garden by submitting its name.

:param body: Required.
:type body: JSON
:type body: ~specs.azure.clientgenerator.core.clientdoc.types.Plant
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -99,11 +100,12 @@ async def harvest(self, body: IO[bytes], *, content_type: str = "application/jso
"""

@distributed_trace_async
async def harvest(self, body: Union[_models.Plant, JSON, IO[bytes]], **kwargs: Any) -> _models.Plant:
async def harvest(self, body: Union[_models.Plant, _types.Plant, IO[bytes]], **kwargs: Any) -> _models.Plant:
"""Retrieves a plant from the garden by submitting its name.

:param body: Is one of the following types: Plant, JSON, IO[bytes] Required.
:type body: ~specs.azure.clientgenerator.core.clientdoc.models.Plant or JSON or IO[bytes]
:param body: Is either a Plant type or a IO[bytes] type. Required.
:type body: ~specs.azure.clientgenerator.core.clientdoc.models.Plant or
~specs.azure.clientgenerator.core.clientdoc.types.Plant or IO[bytes]
:return: Plant. The Plant is compatible with MutableMapping
:rtype: ~specs.azure.clientgenerator.core.clientdoc.models.Plant
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict

from .. import models as _models
from .. import models as _models, types as _types
from .._configuration import ClientDocClientConfiguration
from .._utils.model_base import SdkJSONEncoder, _deserialize
from .._utils.serialization import Deserializer, Serializer

JSON = MutableMapping[str, Any]
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]]

Expand Down Expand Up @@ -88,11 +87,11 @@ def harvest(self, body: _models.Plant, *, content_type: str = "application/json"
"""

@overload
def harvest(self, body: JSON, *, content_type: str = "application/json", **kwargs: Any) -> _models.Plant:
def harvest(self, body: _types.Plant, *, content_type: str = "application/json", **kwargs: Any) -> _models.Plant:
"""Retrieves a plant from the garden by submitting its name.

:param body: Required.
:type body: JSON
:type body: ~specs.azure.clientgenerator.core.clientdoc.types.Plant
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
Default value is "application/json".
:paramtype content_type: str
Expand All @@ -116,11 +115,12 @@ def harvest(self, body: IO[bytes], *, content_type: str = "application/json", **
"""

@distributed_trace
def harvest(self, body: Union[_models.Plant, JSON, IO[bytes]], **kwargs: Any) -> _models.Plant:
def harvest(self, body: Union[_models.Plant, _types.Plant, IO[bytes]], **kwargs: Any) -> _models.Plant:
"""Retrieves a plant from the garden by submitting its name.

:param body: Is one of the following types: Plant, JSON, IO[bytes] Required.
:type body: ~specs.azure.clientgenerator.core.clientdoc.models.Plant or JSON or IO[bytes]
:param body: Is either a Plant type or a IO[bytes] type. Required.
:type body: ~specs.azure.clientgenerator.core.clientdoc.models.Plant or
~specs.azure.clientgenerator.core.clientdoc.types.Plant or IO[bytes]
:return: Plant. The Plant is compatible with MutableMapping
:rtype: ~specs.azure.clientgenerator.core.clientdoc.models.Plant
:raises ~azure.core.exceptions.HttpResponseError:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) Python Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

from typing_extensions import Required, TypedDict


class Plant(TypedDict, total=False):
"""A plant in the garden. This model is used to represent a plant in the client SDK.

:ivar name: The name of the plant. Required.
:vartype name: str
:ivar species: The species of the plant. Required.
:vartype species: str
"""

name: Required[str]
"""The name of the plant. Required."""
species: Required[str]
"""The species of the plant. Required."""
Loading