Skip to content

Commit

Permalink
CodeGen from PR 25026 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 068edffd4531e88deb0bd70b061cf9595c901f0d into fe2113ec4be9d8d52929eee0583d3c841ba3c189
  • Loading branch information
SDKAuto committed Jul 28, 2023
1 parent b646f92 commit 7e29664
Show file tree
Hide file tree
Showing 24 changed files with 67 additions and 64 deletions.
10 changes: 5 additions & 5 deletions sdk/servicenetworking/azure-mgmt-servicenetworking/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "3c639105c011765893db51cbb0dda056e34dc994",
"commit": "5ff3de02c811def22b849e39b4f565782db51541",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"autorest": "3.9.6",
"use": [
"@autorest/python@6.4.8",
"@autorest/modelerfour@4.24.3"
"@autorest/python@6.6.0",
"@autorest/modelerfour@4.26.2"
],
"autorest_command": "autorest specification/servicenetworking/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/python@6.4.8 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/servicenetworking/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/python@6.6.0 --use=@autorest/modelerfour@4.26.2 --version=3.9.6 --version-tolerant=False",
"readme": "specification/servicenetworking/resource-manager/readme.md"
}
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.0b2"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

Expand Down Expand Up @@ -248,7 +249,7 @@ async def _create_or_update_initial(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IO, bytes)):
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "Association")
Expand Down Expand Up @@ -575,7 +576,7 @@ async def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(properties, (IO, bytes)):
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_json = self._serialize.body(properties, "AssociationUpdate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

Expand Down Expand Up @@ -247,7 +248,7 @@ async def _create_or_update_initial(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IO, bytes)):
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "Frontend")
Expand Down Expand Up @@ -573,7 +574,7 @@ async def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(properties, (IO, bytes)):
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_json = self._serialize.body(properties, "FrontendUpdate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

Expand Down Expand Up @@ -326,7 +327,7 @@ async def _create_or_update_initial(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IO, bytes)):
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "TrafficController")
Expand Down Expand Up @@ -636,7 +637,7 @@ async def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(properties, (IO, bytes)):
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_json = self._serialize.body(properties, "TrafficControllerUpdate")
Expand Down Expand Up @@ -722,8 +723,8 @@ async def _delete_initial( # pylint: disable=inconsistent-return-statements

response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))

if cls:
return cls(pipeline_response, None, response_headers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
import urllib.parse

Expand Down Expand Up @@ -61,7 +62,7 @@ def build_list_by_traffic_controller_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
}

Expand Down Expand Up @@ -99,10 +100,10 @@ def build_get_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"associationName": _SERIALIZER.url(
"association_name", association_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -141,10 +142,10 @@ def build_create_or_update_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"associationName": _SERIALIZER.url(
"association_name", association_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -185,10 +186,10 @@ def build_update_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"associationName": _SERIALIZER.url(
"association_name", association_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -228,10 +229,10 @@ def build_delete_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"associationName": _SERIALIZER.url(
"association_name", association_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"association_name", association_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -451,7 +452,7 @@ def _create_or_update_initial(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IO, bytes)):
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "Association")
Expand Down Expand Up @@ -777,7 +778,7 @@ def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(properties, (IO, bytes)):
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_json = self._serialize.body(properties, "AssociationUpdate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
import urllib.parse

Expand Down Expand Up @@ -61,7 +62,7 @@ def build_list_by_traffic_controller_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
}

Expand Down Expand Up @@ -99,10 +100,10 @@ def build_get_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"frontendName": _SERIALIZER.url(
"frontend_name", frontend_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -141,10 +142,10 @@ def build_create_or_update_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"frontendName": _SERIALIZER.url(
"frontend_name", frontend_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -185,10 +186,10 @@ def build_update_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"frontendName": _SERIALIZER.url(
"frontend_name", frontend_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -228,10 +229,10 @@ def build_delete_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
"frontendName": _SERIALIZER.url(
"frontend_name", frontend_name, "str", pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+"
"frontend_name", frontend_name, "str", pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$"
),
}

Expand Down Expand Up @@ -451,7 +452,7 @@ def _create_or_update_initial(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IO, bytes)):
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "Frontend")
Expand Down Expand Up @@ -773,7 +774,7 @@ def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(properties, (IO, bytes)):
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_json = self._serialize.body(properties, "FrontendUpdate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, Callable, Dict, IO, Iterable, Optional, TypeVar, Union, cast, overload
import urllib.parse

Expand Down Expand Up @@ -117,7 +118,7 @@ def build_get_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
}

Expand Down Expand Up @@ -156,7 +157,7 @@ def build_create_or_update_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
}

Expand Down Expand Up @@ -197,7 +198,7 @@ def build_update_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
}

Expand Down Expand Up @@ -237,7 +238,7 @@ def build_delete_request(
"traffic_controller_name",
traffic_controller_name,
"str",
pattern=r"[A-Za-z0-9]+[A-Za-z0-9-_.]{0,62}[A-Za-z0-9_]+",
pattern=r"^[A-Za-z0-9]([A-Za-z0-9-_.]{0,62}[A-Za-z0-9])?$",
),
}

Expand Down Expand Up @@ -529,7 +530,7 @@ def _create_or_update_initial(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(resource, (IO, bytes)):
if isinstance(resource, (IOBase, bytes)):
_content = resource
else:
_json = self._serialize.body(resource, "TrafficController")
Expand Down Expand Up @@ -835,7 +836,7 @@ def update(
content_type = content_type or "application/json"
_json = None
_content = None
if isinstance(properties, (IO, bytes)):
if isinstance(properties, (IOBase, bytes)):
_content = properties
else:
_json = self._serialize.body(properties, "TrafficControllerUpdate")
Expand Down Expand Up @@ -921,8 +922,8 @@ def _delete_initial( # pylint: disable=inconsistent-return-statements

response_headers = {}
if response.status_code == 202:
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))
response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After"))
response_headers["Location"] = self._deserialize("str", response.headers.get("Location"))

if cls:
return cls(pipeline_response, None, response_headers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ def main():
subscription_id="subid",
)

response = client.associations_interface.begin_delete(
client.associations_interface.begin_delete(
resource_group_name="rg1",
traffic_controller_name="tc1",
association_name="as1",
).result()
print(response)


# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/cadl/examples/AssociationDelete.json
# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/preview/2023-05-01-preview/examples/AssociationDelete.json
if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ def main():
print(response)


# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/cadl/examples/AssociationGet.json
# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/preview/2023-05-01-preview/examples/AssociationGet.json
if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ def main():
print(response)


# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/cadl/examples/AssociationPatch.json
# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/preview/2023-05-01-preview/examples/AssociationPatch.json
if __name__ == "__main__":
main()
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ def main():
print(response)


# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/cadl/examples/AssociationPut.json
# x-ms-original-file: specification/servicenetworking/resource-manager/Microsoft.ServiceNetworking/preview/2023-05-01-preview/examples/AssociationPut.json
if __name__ == "__main__":
main()
Loading

0 comments on commit 7e29664

Please sign in to comment.