Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR track2_azure-mgmt-servicenetworking] Fixing TSP for Validation Issues #3707

Closed
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
6 changes: 3 additions & 3 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": "b3b28daa55c628e15c8ebca432484c58e6c16a35",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.8",
"@autorest/python@6.4.12",
"@autorest/modelerfour@4.24.3"
],
"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.4.12 --use=@autorest/modelerfour@4.24.3 --version=3.9.2 --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