Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
b1ca1b7
fix auto-ask-check bug
msyyc Jan 28, 2022
a61a9d5
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Feb 16, 2022
5ae58ab
update comment
BigCat20196 Feb 16, 2022
79a3594
update comment
BigCat20196 Feb 16, 2022
7071377
fix bug
BigCat20196 Feb 17, 2022
8f6fe79
Update main.py
BigCat20196 Feb 17, 2022
8d23d87
Update main.py
msyyc Feb 17, 2022
44faa80
Update main.py
msyyc Feb 17, 2022
84768eb
fix changelog format for new service
BigCat20196 Feb 18, 2022
29f9a86
fix check_pprint_name bug
BigCat20196 Feb 18, 2022
5b11c12
Update main.py
msyyc Feb 18, 2022
6b13133
fix check_pprint_name bug
BigCat20196 Feb 18, 2022
03f63af
Merge branch 'auto-release-debug' of https://github.com/msyyc/azure-s…
BigCat20196 Feb 18, 2022
c53585b
Update main.py
msyyc Feb 21, 2022
8a8b3d7
Merge branch 'main' into auto-release-debug
msyyc Feb 21, 2022
90ab52d
Update main.py
msyyc Mar 4, 2022
c124933
test
BigCat20196 Mar 9, 2022
e6f89a2
test
BigCat20196 Mar 9, 2022
76faf36
change to azclibot
BigCat20196 Mar 9, 2022
ffb8635
change to azure
BigCat20196 Mar 9, 2022
53ada77
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Mar 9, 2022
40a0f74
fix push
BigCat20196 Mar 9, 2022
2f6b174
test
BigCat20196 Mar 9, 2022
d5ce826
update
BigCat20196 Mar 9, 2022
79a553e
update
BigCat20196 Mar 9, 2022
ec747f1
test
BigCat20196 Mar 9, 2022
6f51fc8
test
BigCat20196 Mar 9, 2022
7107723
reduction
BigCat20196 Mar 9, 2022
6885266
update main
BigCat20196 Mar 11, 2022
6c9bbbd
delete f
BigCat20196 Mar 11, 2022
21b6c6b
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Mar 28, 2022
c2cb7e4
Update main.py
BigCat20196 Mar 28, 2022
5164abe
test
BigCat20196 Mar 28, 2022
cdb30c4
test
BigCat20196 Mar 28, 2022
e173adc
test
BigCat20196 Mar 28, 2022
04baa8a
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 Mar 28, 2022
2a9f585
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 Mar 28, 2022
3575ab3
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Mar 29, 2022
0502b3e
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Apr 26, 2022
8b71e04
remove surplus code
msyyc May 7, 2022
68a5273
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 May 18, 2022
a517b29
Update main.py
BigCat20196 May 18, 2022
3841e32
Update main.py
BigCat20196 May 18, 2022
2fdba35
Update main.py
BigCat20196 May 18, 2022
3ad0f64
Update main.py
BigCat20196 May 18, 2022
a32eac7
Update main.py
BigCat20196 May 18, 2022
7148c2a
Update main.py
BigCat20196 May 18, 2022
6d1fbbb
Update main.py
BigCat20196 May 19, 2022
e008315
Update main.py
BigCat20196 May 19, 2022
63bd619
Update main.py
BigCat20196 May 19, 2022
31a7e2d
Update main.py
BigCat20196 May 19, 2022
dd0c4d8
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 May 19, 2022
225a28e
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 May 20, 2022
79c8572
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 May 20, 2022
9c97784
Merge branch 'auto-release-debug' of https://github.com/msyyc/azure-s…
BigCat20196 May 23, 2022
fe21708
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 May 23, 2022
c725d95
merge code
BigCat20196 May 23, 2022
a41959d
fix bug
BigCat20196 May 23, 2022
aed57d8
update
BigCat20196 May 23, 2022
f5bb4c5
test
BigCat20196 May 23, 2022
38d34ba
update code
BigCat20196 May 23, 2022
1b379c0
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jun 6, 2022
047f03c
update bot
BigCat20196 Jun 6, 2022
33da045
update main bot
BigCat20196 Jun 6, 2022
a718531
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 Jun 6, 2022
4bbcce9
Update main.py
BigCat20196 Jun 6, 2022
bfd4d3e
Update main.py
BigCat20196 Jun 6, 2022
6a6585a
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jun 7, 2022
82d4b0f
change branch for test
BigCat20196 Jun 7, 2022
d4269a7
for test
BigCat20196 Jun 7, 2022
544efb8
for test
BigCat20196 Jun 7, 2022
7d46cd8
for test
BigCat20196 Jun 7, 2022
62b3929
add PyYAML
msyyc Jun 8, 2022
146c007
code
msyyc Jun 9, 2022
8edbe37
README.md format
msyyc Jun 9, 2022
ced64c7
multi client
msyyc Jun 10, 2022
539d78c
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jun 10, 2022
0a29f58
code
msyyc Jun 10, 2022
378c1c0
add python_tag
BigCat20196 Jun 10, 2022
6eb0ed1
restore branch
BigCat20196 Jun 10, 2022
1bd12ca
Update PythonSdkLiveTest.yml
BigCat20196 Jun 10, 2022
409ac72
gen multi client
msyyc Jun 10, 2022
35e1a19
update global_conf
BigCat20196 Jun 10, 2022
4f13d5d
Merge branch 'auto-release-debug' of https://github.com/msyyc/azure-s…
BigCat20196 Jun 10, 2022
32bd55f
Update auto_codegen.py
BigCat20196 Jun 10, 2022
845a892
Update generate_sdk.py
BigCat20196 Jun 10, 2022
64de6b8
Update generate_sdk.py
BigCat20196 Jun 10, 2022
7e871b6
Update generate_sdk.py
BigCat20196 Jun 10, 2022
f20bea0
single client gen
msyyc Jun 10, 2022
091bf1f
Update main.py
BigCat20196 Jun 10, 2022
95fe92e
compatible with meta storage code
msyyc Jun 10, 2022
b99079e
add log to lookup readme
msyyc Jun 10, 2022
3f0e9ed
dpg package does not need _meta.json in MAINFEST.in
msyyc Jun 10, 2022
8af7ccb
Update main.py
BigCat20196 Jun 13, 2022
9dd3b1f
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 Jun 13, 2022
293c50f
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jun 13, 2022
fb2a89d
add language, apiviewartifacts
msyyc Jun 13, 2022
1061cb3
uodate edit_sdk_setup
BigCat20196 Jun 14, 2022
a3e777a
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jun 14, 2022
ce4bef8
fix
BigCat20196 Jun 14, 2022
916bd3a
test
BigCat20196 Jun 14, 2022
4278ee3
test
BigCat20196 Jun 14, 2022
5fc5ccf
fix bug
BigCat20196 Jun 14, 2022
c895704
debug
BigCat20196 Jun 14, 2022
4c22e5c
fix bug
BigCat20196 Jun 14, 2022
cded964
fix bug
BigCat20196 Jun 14, 2022
cc60f92
Update main.py
BigCat20196 Jun 14, 2022
1f67dfe
move to ci check
BigCat20196 Jun 14, 2022
88323f7
Update main.py
BigCat20196 Jun 15, 2022
134da8e
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jun 22, 2022
4d8045e
for test
BigCat20196 Jun 22, 2022
b11ff6f
restore
BigCat20196 Jun 22, 2022
c3a1d02
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jul 6, 2022
9449e44
update msg for failed version
BigCat20196 Jul 6, 2022
79ea7e3
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jul 7, 2022
aff78b2
for testing
BigCat20196 Jul 7, 2022
2fbda64
for testing
BigCat20196 Jul 7, 2022
74c9e0c
restore
BigCat20196 Jul 8, 2022
3ec222f
restore
BigCat20196 Jul 8, 2022
c11dac0
pin fastcore version
BigCat20196 Jul 8, 2022
cf332c2
update
BigCat20196 Jul 13, 2022
1b68564
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jul 15, 2022
f889bea
test
BigCat20196 Jul 15, 2022
f7d44a4
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jul 20, 2022
078b246
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Jul 22, 2022
db2f4a3
debug
BigCat20196 Jul 22, 2022
5741f78
debug
BigCat20196 Jul 22, 2022
a36eddb
merge
msyyc Jul 26, 2022
c8877f6
optimize
msyyc Jul 26, 2022
15f033c
Update setup.py
msyyc Jul 26, 2022
374e1f3
sdk generation pipeline support dpg
Jul 26, 2022
937bd21
auto codegen don't use specFolder to define swagger repo's location
Jul 26, 2022
dab3a92
fetch automation_generate.sh recent change to sdk_generate.sh
Jul 26, 2022
7607ffa
set default spec flord as global constant
Jul 27, 2022
0bc45a0
set DEFAULT_SPEC_FOLDER in generate_utils
Jul 27, 2022
354c81a
Merge pull request #1465 from openapi-env-test/dpg-readme-sdkGeneration
msyyc Jul 27, 2022
4d89266
merge
msyyc Jul 28, 2022
ec10281
code
msyyc Jul 28, 2022
9f8b7b0
Merge branch 'auto-release-debug' of https://github.com/msyyc/azure-s…
BigCat20196 Aug 8, 2022
d143427
fix conflict
BigCat20196 Aug 8, 2022
b41f34a
fix auto-release utils
BigCat20196 Aug 8, 2022
1787c9a
code
msyyc Aug 10, 2022
7e05eca
Update main.py
msyyc Aug 10, 2022
dced190
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Aug 17, 2022
e7c45b1
add python commit
BigCat20196 Aug 17, 2022
84f3360
fix conflict
BigCat20196 Aug 17, 2022
f2aa1d7
update branch
BigCat20196 Aug 17, 2022
6cfbbf0
debug
BigCat20196 Aug 17, 2022
aadf989
update
BigCat20196 Aug 17, 2022
921f5dc
Update PythonSdkLiveTest.yml
BigCat20196 Aug 17, 2022
6ff818b
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Aug 24, 2022
87b00d2
test 6.1.3
BigCat20196 Aug 24, 2022
a4bf131
test 6.1.3
BigCat20196 Aug 24, 2022
bff5fa0
Update PythonSdkLiveTest.yml for Azure Pipelines
BigCat20196 Aug 24, 2022
7614fc1
test 6.1.3
BigCat20196 Aug 25, 2022
fffb00f
test
BigCat20196 Aug 25, 2022
75b7f36
test
BigCat20196 Aug 25, 2022
74d2440
rollback
BigCat20196 Aug 26, 2022
14eabd3
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Aug 26, 2022
b4e85e4
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-python …
BigCat20196 Sep 8, 2022
c217780
Update main.py
BigCat20196 Sep 14, 2022
db87181
tmp
BigCat20196 Sep 14, 2022
cc34ba7
generate tests
BigCat20196 Sep 16, 2022
1b08fa1
Merge branch 'auto-release-debug' of https://github.com/msyyc/azure-s…
BigCat20196 Sep 16, 2022
535047a
debug
BigCat20196 Sep 16, 2022
621746a
debug
BigCat20196 Sep 16, 2022
085d5c6
code and test
Sep 16, 2022
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
66 changes: 63 additions & 3 deletions scripts/auto_release/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@
import time
import logging
from glob import glob
from contextlib import suppress
import subprocess
from pathlib import Path
from functools import wraps
from typing import List, Any, Dict

import black
import jinja2
from packaging.version import Version
from ghapi.all import GhApi
from azure.storage.blob import BlobServiceClient, ContainerClient
from util import add_certificate

_LOG = logging.getLogger()

_BLACK_MODE = black.Mode()
_BLACK_MODE.line_length = 120

def return_origin_path(func):
@wraps(func)
Expand Down Expand Up @@ -196,15 +202,17 @@ def generate_code(self):
self.autorest_result = str(Path(os.getenv('TEMP_FOLDER')) / 'temp.json')
with open(self.autorest_result, 'w') as file:
json.dump(input_data, file)
print(f"*** input_data: {input_data}")

# generate code(be careful about the order)
print_exec('python scripts/dev_setup.py -p azure-core')
print_check(f'python -m packaging_tools.auto_codegen {self.autorest_result} {self.autorest_result}')

generate_result = self.get_autorest_result()
print(f"***** generate_result: {generate_result}")
self.tag_is_stable = list(generate_result.values())[0]['tagIsStable']
log(f"tag_is_stable is {self.tag_is_stable}")

print_check(f'python -m packaging_tools.auto_package {self.autorest_result} {self.autorest_result}')

def get_package_name_with_autorest_result(self):
Expand Down Expand Up @@ -452,6 +460,59 @@ def prepare_test_env(self):
add_certificate()
start_test_proxy()

def get_tests_info(self):
code_report = self.sdk_code_path() + '/code_reports/latest/report.json'
multi_code_report = self.sdk_code_path() + '/code_reports/latest/merged_report.json'
if not Path(code_report).exists():
code_report = multi_code_report
with open(code_report, 'r') as reader:
report_json = json.load(reader)
client_name = report_json['client'][0]
operations = report_json['operations']
operation_name = 'Operations'
function_name = 'list'
for op_name, op in operations.items():
if op_name == 'Operations':
continue
for func_name, func in op['functions'].items():
if len(func['parameters']) < 2:
operation_name = op_name
function_name = func_name
break
else:
continue
break
return client_name, operation_name, function_name

@return_origin_path
def prepare_tests(self):
os.chdir('../../../')
print(f"++**: {os.getcwd()}")
test_path = self.sdk_code_path()+'/tests'
if not Path(test_path).exists():
os.mkdir(test_path)
client_name, operation_name, function_name = self.get_tests_info()
template_path = Path('tools/azure-sdk-tools/packaging_tools/templates')
env = jinja2.Environment(loader=jinja2.FileSystemLoader(template_path))
temp = env.get_template('testcase.py')
temp_out = temp.render(package_name_dot=self.package_name,
package=self.package_name,
client=client_name,
operation=operation_name,
function=function_name)
with suppress(black.NothingChanged):
file_content = black.format_file_contents(temp_out, fast=True, mode=_BLACK_MODE)
print("+++*** file: " + f'{test_path}/test_mgmt_{self.package_name}.py')
print(f"+++*** path: {Path(test_path).exists()}")
with open(f'{test_path}/test_mgmt_{self.package_name}.py', 'w', encoding='utf-8') as f:
f.writelines(file_content)

if not Path(f'{test_path}/conftest.py').exists():
with open(template_path/'conftest.py', 'r') as fr:
content = fr.read()
with open(f'{test_path}/conftest.py', 'w') as fw:
fw.write(content)

@return_origin_path
def run_test_proc(self):
# run test
Expand All @@ -462,8 +523,7 @@ def run_test_proc(self):
print_check(f'pytest --collect-only')
except:
log('live test run done, do not find any test !!!')
self.test_result = succeeded_result
return
self.prepare_tests()

try:
print_check(f'pytest -s')
Expand Down
4 changes: 3 additions & 1 deletion scripts/auto_release/requirement.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ ghapi==0.1.19
packaging==21.3
pytest==6.2.5
azure-storage-blob==12.9.0
fastcore==1.3.25
fastcore==1.3.25
jinja2==3.1.2
black==22.8.0
9 changes: 9 additions & 0 deletions sdk/appcontainers/azure-mgmt-appcontainers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release History

## 2.0.0 (2022-09-16)

### Breaking Changes

- Model CustomHostnameAnalysisResult no longer has parameter id
- Model CustomHostnameAnalysisResult no longer has parameter name
- Model CustomHostnameAnalysisResult no longer has parameter system_data
- Model CustomHostnameAnalysisResult no longer has parameter type

## 1.0.0 (2022-05-17)

**Breaking changes**
Expand Down
2 changes: 1 addition & 1 deletion sdk/appcontainers/azure-mgmt-appcontainers/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include _meta.json
recursive-include tests *.py *.yaml
recursive-include tests *.py *.json
include *.md
include azure/__init__.py
include azure/mgmt/__init__.py
Expand Down
4 changes: 1 addition & 3 deletions sdk/appcontainers/azure-mgmt-appcontainers/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure Appcontainers Management Client Library.
This package has been tested with Python 3.6+.
This package has been tested with Python 3.7+.
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).

## _Disclaimer_
Expand All @@ -12,8 +12,6 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For


To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)



For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
Code samples for this package can be found at [Appcontainers Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
Expand Down
10 changes: 5 additions & 5 deletions sdk/appcontainers/azure-mgmt-appcontainers/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.7.2",
"autorest": "3.8.4",
"use": [
"@autorest/python@5.13.0",
"@autorest/modelerfour@4.19.3"
"@autorest/python@6.1.5",
"@autorest/modelerfour@4.23.5"
],
"commit": "32143b0f5f230ee2601e3c5d1990188666a5058d",
"commit": "9d383206b1a2748625204592bb355f78342f1ddd",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/app/resource-manager/readme.md --multiapi --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --use=@autorest/python@5.13.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"autorest_command": "autorest specification/app/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.5 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
"readme": "specification/app/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
from ._version import VERSION

__version__ = VERSION
__all__ = ['ContainerAppsAPIClient']

# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
try:
from ._patch import __all__ as _patch_all
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk

__all__ = ["ContainerAppsAPIClient"]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,18 @@ class ContainerAppsAPIClientConfiguration(Configuration): # pylint: disable=too
Note that all parameters used to create this instance are saved as instance
attributes.

:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2022-03-01". Note that overriding this
default value may result in unsupported behavior.
:paramtype api_version: str
"""

def __init__(
self,
credential: "TokenCredential",
subscription_id: str,
**kwargs: Any
) -> None:
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
super(ContainerAppsAPIClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-03-01") # type: str
api_version = kwargs.pop("api_version", "2022-03-01") # type: str

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -51,23 +46,24 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-appcontainers/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-appcontainers/{}".format(VERSION))
self._configure(**kwargs)

def _configure(
self,
**kwargs # type: Any
self, **kwargs # type: Any
):
# type: (...) -> None
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get("authentication_policy")
if self.credential and not self.authentication_policy:
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(
self.credential, *self.credential_scopes, **kwargs
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,32 @@
from copy import deepcopy
from typing import Any, TYPE_CHECKING

from msrest import Deserializer, Serializer

from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient

from . import models
from ._configuration import ContainerAppsAPIClientConfiguration
from .operations import CertificatesOperations, ContainerAppsAuthConfigsOperations, ContainerAppsOperations, ContainerAppsRevisionReplicasOperations, ContainerAppsRevisionsOperations, ContainerAppsSourceControlsOperations, DaprComponentsOperations, ManagedEnvironmentsOperations, ManagedEnvironmentsStoragesOperations, NamespacesOperations, Operations
from ._serialization import Deserializer, Serializer
from .operations import (
CertificatesOperations,
ContainerAppsAuthConfigsOperations,
ContainerAppsOperations,
ContainerAppsRevisionReplicasOperations,
ContainerAppsRevisionsOperations,
ContainerAppsSourceControlsOperations,
DaprComponentsOperations,
ManagedEnvironmentsOperations,
ManagedEnvironmentsStoragesOperations,
NamespacesOperations,
Operations,
)

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials import TokenCredential

class ContainerAppsAPIClient: # pylint: disable=too-many-instance-attributes

class ContainerAppsAPIClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""ContainerAppsAPIClient.

:ivar container_apps_auth_configs: ContainerAppsAuthConfigsOperations operations
Expand Down Expand Up @@ -53,9 +65,9 @@ class ContainerAppsAPIClient: # pylint: disable=too-many-instance-attributes
:ivar container_apps_source_controls: ContainerAppsSourceControlsOperations operations
:vartype container_apps_source_controls:
azure.mgmt.appcontainers.operations.ContainerAppsSourceControlsOperations
:param credential: Credential needed for the client to connect to Azure.
:param credential: Credential needed for the client to connect to Azure. Required.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
:param subscription_id: The ID of the target subscription. Required.
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
Expand All @@ -73,31 +85,40 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ContainerAppsAPIClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._config = ContainerAppsAPIClientConfiguration(
credential=credential, subscription_id=subscription_id, **kwargs
)
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_auth_configs = ContainerAppsAuthConfigsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps = ContainerAppsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_revisions = ContainerAppsRevisionsOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_revision_replicas = ContainerAppsRevisionReplicasOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_revisions = ContainerAppsRevisionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps_revision_replicas = ContainerAppsRevisionReplicasOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.dapr_components = DaprComponentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments = ManagedEnvironmentsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments = ManagedEnvironmentsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.certificates = CertificatesOperations(self._client, self._config, self._serialize, self._deserialize)
self.namespaces = NamespacesOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_environments_storages = ManagedEnvironmentsStoragesOperations(self._client, self._config, self._serialize, self._deserialize)
self.container_apps_source_controls = ContainerAppsSourceControlsOperations(self._client, self._config, self._serialize, self._deserialize)


def _send_request(
self,
request: HttpRequest,
**kwargs: Any
) -> HttpResponse:
self.managed_environments_storages = ManagedEnvironmentsStoragesOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.container_apps_source_controls = ContainerAppsSourceControlsOperations(
self._client, self._config, self._serialize, self._deserialize
)

def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
"""Runs the network request through the client's chained policies.

>>> from azure.core.rest import HttpRequest
Expand All @@ -106,7 +127,7 @@ def _send_request(
>>> response = client._send_request(request)
<HttpResponse: 200 OK>

For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request

:param request: The network request you want to make. Required.
:type request: ~azure.core.rest.HttpRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
pass
Loading