WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@autorest/python"
- "@azure-tools/typespec-python"
---

bump dev version of azure-http-specs to fix nightly build failure
4 changes: 2 additions & 2 deletions packages/autorest.python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"homepage": "https://github.com/Azure/autorest.python/blob/main/README.md",
"dependencies": {
"@typespec/http-client-python": "~0.23.1",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTY4NjczMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.23.1.tgz",
"@autorest/system-requirements": "~1.0.2",
"fs-extra": "~11.2.0",
"tsx": "~4.19.1"
Expand All @@ -47,4 +47,4 @@
"requirements.txt",
"generator/"
]
}
}
8 changes: 4 additions & 4 deletions packages/typespec-python/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"js-yaml": "~4.1.0",
"semver": "~7.6.2",
"tsx": "~4.19.1",
"@typespec/http-client-python": "~0.23.1",
"@typespec/http-client-python": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNTY4NjczMS9hcnRpZmFjdE5hbWUvYnVpbGRfYXJ0aWZhY3RzX3B5dGhvbg2/content?format=file&subPath=%2Fpackages%2Ftypespec-http-client-python-0.23.1.tgz",
"fs-extra": "~11.2.0"
},
"devDependencies": {
Expand All @@ -86,8 +86,8 @@
"@azure-tools/typespec-azure-rulesets": "~0.63.0",
"@azure-tools/typespec-autorest": "~0.63.0",
"@azure-tools/typespec-client-generator-core": "~0.63.0",
"@azure-tools/azure-http-specs": "0.1.0-alpha.33",
"@typespec/http-specs": "0.1.0-alpha.29",
"@azure-tools/azure-http-specs": "0.1.0-alpha.34-dev.7",
"@typespec/http-specs": "0.1.0-alpha.30-dev.1",
"@typespec/spector": "0.1.0-alpha.21",
"@typespec/spec-api": "0.1.0-alpha.11",
"@types/js-yaml": "~4.0.5",
Expand All @@ -103,4 +103,4 @@
"chalk": "5.3.0",
"@types/fs-extra": "11.0.4"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

## 1.0.0b1 (1970-01-01)

- Initial version
### Other Changes

- Initial version
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include *.md
include LICENSE
include specs/azure/clientgenerator/core/clientlocation/py.typed
include specs/azure/clientgenerator/core/clientdefaultvalue/py.typed
recursive-include tests *.py
recursive-include samples *.py *.md
include specs/__init__.py
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Specs Azure Clientgenerator Core Clientdefaultvalue client library for Python
<!-- write necessary description of service -->

## Getting started

### Install the package

```bash
python -m pip install specs-azure-clientgenerator-core-clientdefaultvalue
```

#### Prequisites

- Python 3.9 or later is required to use this package.
- You need an [Azure subscription][azure_sub] to use this package.
- An existing Specs Azure Clientgenerator Core Clientdefaultvalue instance.


## Contributing

This project welcomes contributions and suggestions. Most contributions require
you to agree to a Contributor License Agreement (CLA) declaring that you have
the right to, and actually do, grant us the rights to use your contribution.
For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether
you need to provide a CLA and decorate the PR appropriately (e.g., label,
comment). Simply follow the instructions provided by the bot. You will only
need to do this once across all repos using our CLA.

This project has adopted the
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
see the Code of Conduct FAQ or contact [email protected] with any
additional questions or comments.

<!-- LINKS -->
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
[azure_identity_pip]: https://pypi.org/project/azure-identity/
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
[pip]: https://pypi.org/project/pip/
[azure_sub]: https://azure.microsoft.com/free/
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"CrossLanguagePackageId": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue",
"CrossLanguageDefinitionId": {
"specs.azure.clientgenerator.core.clientdefaultvalue.models.ModelWithDefaultValues": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.ModelWithDefaultValues",
"specs.azure.clientgenerator.core.clientdefaultvalue.ClientDefaultValueClient.put_model_property": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.putModelProperty",
"specs.azure.clientgenerator.core.clientdefaultvalue.aio.ClientDefaultValueClient.put_model_property": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.putModelProperty",
"specs.azure.clientgenerator.core.clientdefaultvalue.ClientDefaultValueClient.get_operation_parameter": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.getOperationParameter",
"specs.azure.clientgenerator.core.clientdefaultvalue.aio.ClientDefaultValueClient.get_operation_parameter": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.getOperationParameter",
"specs.azure.clientgenerator.core.clientdefaultvalue.ClientDefaultValueClient.get_path_parameter": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.getPathParameter",
"specs.azure.clientgenerator.core.clientdefaultvalue.aio.ClientDefaultValueClient.get_path_parameter": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.getPathParameter",
"specs.azure.clientgenerator.core.clientdefaultvalue.ClientDefaultValueClient.get_header_parameter": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.getHeaderParameter",
"specs.azure.clientgenerator.core.clientdefaultvalue.aio.ClientDefaultValueClient.get_header_parameter": "_Specs_.Azure.ClientGenerator.Core.ClientDefaultValue.getHeaderParameter"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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.
# --------------------------------------------------------------------------
import os
import pytest
from dotenv import load_dotenv
from devtools_testutils import (
test_proxy,
add_general_regex_sanitizer,
add_body_key_sanitizer,
add_header_regex_sanitizer,
)

load_dotenv()


# For security, please avoid record sensitive identity information in recordings
@pytest.fixture(scope="session", autouse=True)
def add_sanitizers(test_proxy):
defaultvalue_subscription_id = os.environ.get(
"DEFAULTVALUE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000"
)
defaultvalue_tenant_id = os.environ.get("DEFAULTVALUE_TENANT_ID", "00000000-0000-0000-0000-000000000000")
defaultvalue_client_id = os.environ.get("DEFAULTVALUE_CLIENT_ID", "00000000-0000-0000-0000-000000000000")
defaultvalue_client_secret = os.environ.get("DEFAULTVALUE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=defaultvalue_subscription_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=defaultvalue_tenant_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=defaultvalue_client_id, value="00000000-0000-0000-0000-000000000000")
add_general_regex_sanitizer(regex=defaultvalue_client_secret, value="00000000-0000-0000-0000-000000000000")

add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]")
add_header_regex_sanitizer(key="Cookie", value="cookie;")
add_body_key_sanitizer(json_path="$..access_token", value="access_token")
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# 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.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils import recorded_by_proxy
from testpreparer import ClientDefaultValueClientTestBase, DefaultValuePreparer


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestDefaultValue(ClientDefaultValueClientTestBase):
@DefaultValuePreparer()
@recorded_by_proxy
def test_put_model_property(self, defaultvalue_endpoint):
client = self.create_client(endpoint=defaultvalue_endpoint)
response = client.put_model_property(
body={"name": "str", "retry": bool, "tier": "str", "timeout": 0},
)

# please add some check logic here by yourself
# ...

@DefaultValuePreparer()
@recorded_by_proxy
def test_get_operation_parameter(self, defaultvalue_endpoint):
client = self.create_client(endpoint=defaultvalue_endpoint)
response = client.get_operation_parameter(
name="str",
)

# please add some check logic here by yourself
# ...

@DefaultValuePreparer()
@recorded_by_proxy
def test_get_path_parameter(self, defaultvalue_endpoint):
client = self.create_client(endpoint=defaultvalue_endpoint)
response = client.get_path_parameter(
segment2="str",
segment1="str",
)

# please add some check logic here by yourself
# ...

@DefaultValuePreparer()
@recorded_by_proxy
def test_get_header_parameter(self, defaultvalue_endpoint):
client = self.create_client(endpoint=defaultvalue_endpoint)
response = client.get_header_parameter()

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# 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.
# --------------------------------------------------------------------------
import pytest
from devtools_testutils.aio import recorded_by_proxy_async
from testpreparer import DefaultValuePreparer
from testpreparer_async import ClientDefaultValueClientTestBaseAsync


@pytest.mark.skip("you may need to update the auto-generated test case before run it")
class TestDefaultValueAsync(ClientDefaultValueClientTestBaseAsync):
@DefaultValuePreparer()
@recorded_by_proxy_async
async def test_put_model_property(self, defaultvalue_endpoint):
client = self.create_async_client(endpoint=defaultvalue_endpoint)
response = await client.put_model_property(
body={"name": "str", "retry": bool, "tier": "str", "timeout": 0},
)

# please add some check logic here by yourself
# ...

@DefaultValuePreparer()
@recorded_by_proxy_async
async def test_get_operation_parameter(self, defaultvalue_endpoint):
client = self.create_async_client(endpoint=defaultvalue_endpoint)
response = await client.get_operation_parameter(
name="str",
)

# please add some check logic here by yourself
# ...

@DefaultValuePreparer()
@recorded_by_proxy_async
async def test_get_path_parameter(self, defaultvalue_endpoint):
client = self.create_async_client(endpoint=defaultvalue_endpoint)
response = await client.get_path_parameter(
segment2="str",
segment1="str",
)

# please add some check logic here by yourself
# ...

@DefaultValuePreparer()
@recorded_by_proxy_async
async def test_get_header_parameter(self, defaultvalue_endpoint):
client = self.create_async_client(endpoint=defaultvalue_endpoint)
response = await client.get_header_parameter()

# please add some check logic here by yourself
# ...
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 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 devtools_testutils import AzureRecordedTestCase, PowerShellPreparer
import functools
from specs.azure.clientgenerator.core.clientdefaultvalue import ClientDefaultValueClient


class ClientDefaultValueClientTestBase(AzureRecordedTestCase):

def create_client(self, endpoint):
credential = self.get_credential(ClientDefaultValueClient)
return self.create_client_from_credential(
ClientDefaultValueClient,
credential=credential,
endpoint=endpoint,
)


DefaultValuePreparer = functools.partial(
PowerShellPreparer, "defaultvalue", defaultvalue_endpoint="https://fake_defaultvalue_endpoint.com"
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# 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 devtools_testutils import AzureRecordedTestCase
from specs.azure.clientgenerator.core.clientdefaultvalue.aio import ClientDefaultValueClient


class ClientDefaultValueClientTestBaseAsync(AzureRecordedTestCase):

def create_async_client(self, endpoint):
credential = self.get_credential(ClientDefaultValueClient, is_async=True)
return self.create_client_from_credential(
ClientDefaultValueClient,
credential=credential,
endpoint=endpoint,
)
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ requires = ["setuptools>=77.0.3", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "specs-azure-clientgenerator-core-clientlocation"
name = "specs-azure-clientgenerator-core-clientdefaultvalue"
authors = [
{ name = "Microsoft Corporation", email = "[email protected]" },
]
description = "Microsoft Corporation Azure Specs Azure Clientgenerator Core Clientlocation Client Library for Python"
description = "Microsoft Corporation Azure Specs Azure Clientgenerator Core Clientdefaultvalue Client Library for Python"
license = "MIT"
classifiers = [
"Development Status :: 4 - Beta",
Expand Down Expand Up @@ -43,7 +43,7 @@ dynamic = [
repository = "https://github.com/Azure/azure-sdk-for-python"

[tool.setuptools.dynamic]
version = {attr = "specs.azure.clientgenerator.core.clientlocation._version.VERSION"}
version = {attr = "specs.azure.clientgenerator.core.clientdefaultvalue._version.VERSION"}
readme = {file = ["README.md", "CHANGELOG.md"], content-type = "text/markdown"}

[tool.setuptools.packages.find]
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.
# --------------------------------------------------------------------------
# pylint: disable=wrong-import-position

from typing import TYPE_CHECKING

if TYPE_CHECKING:
from ._patch import * # pylint: disable=unused-wildcard-import

from ._client import ClientDefaultValueClient # type: ignore
from ._version import VERSION

__version__ = VERSION

try:
from ._patch import __all__ as _patch_all
from ._patch import *
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = [
"ClientDefaultValueClient",
]
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore

_patch_sdk()
Loading
Loading