@typespec/http-client-python 0.12.3 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emitter/types.d.ts.map +1 -1
- package/dist/emitter/types.js +12 -5
- package/dist/emitter/types.js.map +1 -1
- package/emitter/src/types.ts +14 -7
- package/emitter/temp/tsconfig.tsbuildinfo +1 -1
- package/eng/scripts/ci/regenerate.ts +3 -0
- package/eng/scripts/setup/__pycache__/package_manager.cpython-39.pyc +0 -0
- package/eng/scripts/setup/__pycache__/venvtools.cpython-39.pyc +0 -0
- package/eng/scripts/setup/build_pygen_wheel.py +9 -10
- package/eng/scripts/setup/install.py +13 -17
- package/eng/scripts/setup/package_manager.py +139 -0
- package/eng/scripts/setup/prepare.py +4 -12
- package/eng/scripts/setup/venvtools.py +1 -42
- package/generator/build/lib/pygen/codegen/models/property.py +6 -0
- package/generator/build/lib/pygen/codegen/templates/packaging_templates/README.md.jinja2 +31 -0
- package/generator/dist/pygen-0.1.0-py3-none-any.whl +0 -0
- package/generator/pygen/codegen/models/property.py +6 -0
- package/generator/pygen/codegen/templates/packaging_templates/README.md.jinja2 +31 -0
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_commonproperties_async.py +31 -0
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_largeheader_async.py +30 -0
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_arm_nonresource_async.py +36 -0
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_client_initialization_async.py +9 -0
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_deserialize_empty_string_as_null_async.py +20 -0
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_client_generator_core_usage_async.py +7 -0
- package/generator/test/azure/mock_api_tests/asynctests/test_azure_encode_duration_async.py +19 -0
- package/generator/test/azure/mock_api_tests/test_azure_arm_commonproperties.py +29 -0
- package/generator/test/azure/mock_api_tests/test_azure_arm_largeheader.py +27 -0
- package/generator/test/azure/mock_api_tests/test_azure_arm_nonresource.py +34 -0
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_client_initialization.py +8 -0
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_deserialize_empty_string_as_null.py +19 -0
- package/generator/test/azure/mock_api_tests/test_azure_client_generator_core_usage.py +4 -0
- package/generator/test/azure/mock_api_tests/test_azure_encode_duration.py +18 -0
- package/generator/test/azure/requirements.txt +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
+
# license information.
|
|
5
|
+
# --------------------------------------------------------------------------
|
|
6
|
+
import pytest
|
|
7
|
+
from azure.resourcemanager.largeheader import LargeHeaderClient
|
|
8
|
+
from azure.resourcemanager.largeheader import models
|
|
9
|
+
|
|
10
|
+
SUBSCRIPTION_ID = "00000000-0000-0000-0000-000000000000"
|
|
11
|
+
RESOURCE_GROUP_NAME = "test-rg"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@pytest.fixture
|
|
15
|
+
def client(credential, authentication_policy):
|
|
16
|
+
with LargeHeaderClient(
|
|
17
|
+
credential, SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy
|
|
18
|
+
) as client:
|
|
19
|
+
yield client
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_large_headers_begin_two6_k(client: LargeHeaderClient):
|
|
23
|
+
result = client.large_headers.begin_two6_k(
|
|
24
|
+
resource_group_name=RESOURCE_GROUP_NAME,
|
|
25
|
+
large_header_name="header1",
|
|
26
|
+
).result()
|
|
27
|
+
assert result == models.CancelResult(succeeded=True)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
+
# license information.
|
|
5
|
+
# --------------------------------------------------------------------------
|
|
6
|
+
import pytest
|
|
7
|
+
from azure.resourcemanager.nonresource import NonResourceClient
|
|
8
|
+
from azure.resourcemanager.nonresource import models
|
|
9
|
+
|
|
10
|
+
SUBSCRIPTION_ID = "00000000-0000-0000-0000-000000000000"
|
|
11
|
+
RESOURCE_GROUP_NAME = "test-rg"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@pytest.fixture
|
|
15
|
+
def client(credential, authentication_policy):
|
|
16
|
+
with NonResourceClient(
|
|
17
|
+
credential, SUBSCRIPTION_ID, "http://localhost:3000", authentication_policy=authentication_policy
|
|
18
|
+
) as client:
|
|
19
|
+
yield client
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def test_non_resource_create(client: NonResourceClient):
|
|
23
|
+
result = client.non_resource_operations.create(
|
|
24
|
+
location="eastus", parameter="hello", body=models.NonResource(id="id", name="hello", type="nonResource")
|
|
25
|
+
)
|
|
26
|
+
assert result == models.NonResource(id="id", name="hello", type="nonResource")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_non_resource_get(client: NonResourceClient):
|
|
30
|
+
result = client.non_resource_operations.get(
|
|
31
|
+
location="eastus",
|
|
32
|
+
parameter="hello",
|
|
33
|
+
)
|
|
34
|
+
assert result == models.NonResource(id="id", name="hello", type="nonResource")
|
|
@@ -9,6 +9,7 @@ from specs.azure.clientgenerator.core.clientinitialization import (
|
|
|
9
9
|
MixedParamsClient,
|
|
10
10
|
PathParamClient,
|
|
11
11
|
ParamAliasClient,
|
|
12
|
+
ParentClient,
|
|
12
13
|
)
|
|
13
14
|
from specs.azure.clientgenerator.core.clientinitialization.models import Input
|
|
14
15
|
|
|
@@ -42,3 +43,10 @@ def test_param_alias_client():
|
|
|
42
43
|
with ParamAliasClient("sample-blob") as client:
|
|
43
44
|
client.with_aliased_name()
|
|
44
45
|
client.with_original_name()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# def test_parent_child_client():
|
|
49
|
+
# with ParentClient() as client:
|
|
50
|
+
# client.child_client.with_query()
|
|
51
|
+
# client.child_client.get_standalone()
|
|
52
|
+
# client.child_client.delete_standalone()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
+
# license information.
|
|
5
|
+
# --------------------------------------------------------------------------
|
|
6
|
+
import pytest
|
|
7
|
+
from specs.azure.clientgenerator.core.emptystring import DeserializeEmptyStringAsNullClient
|
|
8
|
+
from specs.azure.clientgenerator.core.emptystring import models
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.fixture
|
|
12
|
+
def client():
|
|
13
|
+
with DeserializeEmptyStringAsNullClient() as client:
|
|
14
|
+
yield client
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_get(client: DeserializeEmptyStringAsNullClient):
|
|
18
|
+
result = client.get()
|
|
19
|
+
assert result == models.ResponseModel(sample_url="")
|
|
@@ -26,3 +26,7 @@ def test_model_usage(client: UsageClient):
|
|
|
26
26
|
assert models.RoundTripModel(
|
|
27
27
|
result=models.ResultModel(name="Madge")
|
|
28
28
|
) == client.model_in_operation.model_in_read_only_property(body=models.RoundTripModel())
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
# def test_orphan_model_serializable(client: UsageClient):
|
|
32
|
+
# client.model_in_operation.orphan_model_serializable(body=models.OrphanModel(model_name="name", description="desc"))
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# -------------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for
|
|
4
|
+
# license information.
|
|
5
|
+
# --------------------------------------------------------------------------
|
|
6
|
+
import pytest
|
|
7
|
+
from specs.azure.encode.duration import DurationClient
|
|
8
|
+
from specs.azure.encode.duration import models
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@pytest.fixture
|
|
12
|
+
def client():
|
|
13
|
+
with DurationClient() as client:
|
|
14
|
+
yield client
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_duration_constant(client: DurationClient):
|
|
18
|
+
client.duration_constant(models.DurationModel(input="1.02:59:59.5000000"))
|
|
@@ -5,6 +5,7 @@ azure-mgmt-core==1.5.0
|
|
|
5
5
|
# only for azure
|
|
6
6
|
-e ./generated/azure-client-generator-core-access
|
|
7
7
|
-e ./generated/azure-client-generator-core-client-initialization
|
|
8
|
+
-e ./generated/azure-client-generator-core-deserialize-empty-string-as-null
|
|
8
9
|
-e ./generated/azure-client-generator-core-flatten-property
|
|
9
10
|
-e ./generated/azure-client-generator-core-usage
|
|
10
11
|
-e ./generated/azure-core-basic
|
|
@@ -14,9 +15,12 @@ azure-mgmt-core==1.5.0
|
|
|
14
15
|
-e ./generated/azure-core-model
|
|
15
16
|
-e ./generated/azure-core-traits
|
|
16
17
|
-e ./generated/azure-core-page
|
|
18
|
+
-e ./generated/azure-encode-duration
|
|
17
19
|
-e ./generated/azure-special-headers-client-request-id/
|
|
18
20
|
-e ./generated/azure-example-basic
|
|
19
21
|
-e ./generated/azure-resource-manager-common-properties
|
|
22
|
+
-e ./generated/azure-resource-manager-large-header
|
|
23
|
+
-e ./generated/azure-resource-manager-non-resource
|
|
20
24
|
-e ./generated/azure-resource-manager-operation-templates
|
|
21
25
|
-e ./generated/azure-resource-manager-resources
|
|
22
26
|
# -e ./generated/client-namespace
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typespec/http-client-python",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec emitter for Python SDKs",
|
|
6
6
|
"homepage": "https://typespec.io",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"@azure-tools/typespec-azure-core": "~0.57.0",
|
|
82
82
|
"@azure-tools/typespec-azure-resource-manager": "~0.57.0",
|
|
83
83
|
"@azure-tools/typespec-azure-rulesets": "~0.57.0",
|
|
84
|
-
"@azure-tools/typespec-client-generator-core": "~0.57.
|
|
85
|
-
"@azure-tools/azure-http-specs": "0.1.0-alpha.
|
|
84
|
+
"@azure-tools/typespec-client-generator-core": "~0.57.2",
|
|
85
|
+
"@azure-tools/azure-http-specs": "0.1.0-alpha.20",
|
|
86
86
|
"@typespec/compiler": "^1.1.0",
|
|
87
87
|
"@typespec/http": "^1.1.0",
|
|
88
88
|
"@typespec/openapi": "^1.1.0",
|