Skip to content

Commit 2bb0d9d

Browse files
author
SDKAuto
committed
CodeGen from PR 32282 in Azure/azure-rest-api-specs
Merge 3f8b2c6b438fc8bfb90100e29a602e69d8319bd5 into e0ef299f475a972c2856175014bf4f1e9873dda0
1 parent 7656cf2 commit 2bb0d9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4531
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (1970-01-01)
4+
5+
- Initial version
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include *.md
2+
include LICENSE
3+
include microsoft/codetransparency/py.typed
4+
recursive-include tests *.py
5+
recursive-include samples *.py *.md
6+
include microsoft/__init__.py
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
2+
3+
# Code Transparency Service client library for Python
4+
<!-- write necessary description of service -->
5+
6+
## Getting started
7+
8+
### Install the package
9+
10+
```bash
11+
python -m pip install microsoft-codetransparency
12+
```
13+
14+
#### Prequisites
15+
16+
- Python 3.8 or later is required to use this package.
17+
- You need an [Azure subscription][azure_sub] to use this package.
18+
- An existing Code Transparency Service instance.
19+
20+
## Contributing
21+
22+
This project welcomes contributions and suggestions. Most contributions require
23+
you to agree to a Contributor License Agreement (CLA) declaring that you have
24+
the right to, and actually do, grant us the rights to use your contribution.
25+
For details, visit https://cla.microsoft.com.
26+
27+
When you submit a pull request, a CLA-bot will automatically determine whether
28+
you need to provide a CLA and decorate the PR appropriately (e.g., label,
29+
comment). Simply follow the instructions provided by the bot. You will only
30+
need to do this once across all repos using our CLA.
31+
32+
This project has adopted the
33+
[Microsoft Open Source Code of Conduct][code_of_conduct]. For more information,
34+
see the Code of Conduct FAQ or contact [email protected] with any
35+
additional questions or comments.
36+
37+
<!-- LINKS -->
38+
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
39+
[authenticate_with_token]: https://docs.microsoft.com/azure/cognitive-services/authentication?tabs=powershell#authenticate-with-an-authentication-token
40+
[azure_identity_credentials]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#credentials
41+
[azure_identity_pip]: https://pypi.org/project/azure-identity/
42+
[default_azure_credential]: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity#defaultazurecredential
43+
[pip]: https://pypi.org/project/pip/
44+
[azure_sub]: https://azure.microsoft.com/free/
45+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"commit": "7e6420ddb9ab2ea27908c69cf122d78eda6ef819",
3+
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
4+
"typespec_src": "specification/confidentialledger/Microsoft.CodeTransparency",
5+
"@azure-tools/typespec-python": "0.40.0"
6+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"CrossLanguagePackageId": "Microsoft.CodeTransparency",
3+
"CrossLanguageDefinitionId": {
4+
"microsoft.codetransparency.CodeTransparencyClient.get_transparency_config_cbor": "Microsoft.CodeTransparency.getTransparencyConfigCbor",
5+
"microsoft.codetransparency.CodeTransparencyClient.get_public_keys": "Microsoft.CodeTransparency.getPublicKeys",
6+
"microsoft.codetransparency.CodeTransparencyClient.create_entry": "Microsoft.CodeTransparency.createEntry",
7+
"microsoft.codetransparency.CodeTransparencyClient.get_operation": "Microsoft.CodeTransparency.getOperation",
8+
"microsoft.codetransparency.CodeTransparencyClient.get_entry": "Microsoft.CodeTransparency.getEntry",
9+
"microsoft.codetransparency.CodeTransparencyClient.get_entry_statement": "Microsoft.CodeTransparency.getEntryStatement"
10+
}
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-e ../../../tools/azure-sdk-tools
2+
../../core/azure-core
3+
aiohttp
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
import os
10+
11+
from azure.core.credentials import AzureKeyCredential
12+
13+
from microsoft.codetransparency import CodeTransparencyClient
14+
15+
"""
16+
# PREREQUISITES
17+
pip install microsoft-codetransparency
18+
# USAGE
19+
python create_entry.py
20+
21+
Before run the sample, please set environment variables AZURE_KEY with real value
22+
which can access your service
23+
"""
24+
25+
26+
def main():
27+
client = CodeTransparencyClient(
28+
endpoint="ENDPOINT",
29+
credential=AzureKeyCredential(key=os.getenv("AZURE_KEY")),
30+
)
31+
32+
response = client.create_entry(
33+
body="{binary}",
34+
)
35+
print(response)
36+
37+
38+
# x-ms-original-file: 2025-01-31-preview/CreateEntry.json
39+
if __name__ == "__main__":
40+
main()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
import os
10+
11+
from azure.core.credentials import AzureKeyCredential
12+
13+
from microsoft.codetransparency import CodeTransparencyClient
14+
15+
"""
16+
# PREREQUISITES
17+
pip install microsoft-codetransparency
18+
# USAGE
19+
python get_entry.py
20+
21+
Before run the sample, please set environment variables AZURE_KEY with real value
22+
which can access your service
23+
"""
24+
25+
26+
def main():
27+
client = CodeTransparencyClient(
28+
endpoint="ENDPOINT",
29+
credential=AzureKeyCredential(key=os.getenv("AZURE_KEY")),
30+
)
31+
32+
response = client.get_entry(
33+
entry_id="2.131",
34+
)
35+
print(response)
36+
37+
38+
# x-ms-original-file: 2025-01-31-preview/GetEntry.json
39+
if __name__ == "__main__":
40+
main()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) Python Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
import os
10+
11+
from azure.core.credentials import AzureKeyCredential
12+
13+
from microsoft.codetransparency import CodeTransparencyClient
14+
15+
"""
16+
# PREREQUISITES
17+
pip install microsoft-codetransparency
18+
# USAGE
19+
python get_entry_statement.py
20+
21+
Before run the sample, please set environment variables AZURE_KEY with real value
22+
which can access your service
23+
"""
24+
25+
26+
def main():
27+
client = CodeTransparencyClient(
28+
endpoint="ENDPOINT",
29+
credential=AzureKeyCredential(key=os.getenv("AZURE_KEY")),
30+
)
31+
32+
response = client.get_entry_statement(
33+
entry_id="2.131",
34+
)
35+
print(response)
36+
37+
38+
# x-ms-original-file: 2025-01-31-preview/GetEntryStatement.json
39+
if __name__ == "__main__":
40+
main()

0 commit comments

Comments
 (0)